Git Product home page Git Product logo

octoprint-tasmota's Introduction

OctoPrint-Tasmota

This plugin is to control devices that have been flashed with Tasmota via web calls.

Requires minimum Tasmota firmware version 5.11.0.

Single relay devices need to use 1 for index.

Screenshots

screenshot

screenshot

screenshot

Setup

Install via the bundled Plugin Manager or manually using this URL:

https://github.com/jneilliii/OctoPrint-Tasmota/archive/master.zip

Configuration

Once installed go into settings and enter the ip address for your Tasmota device. Adjust additional settings as needed.

Settings Explained

  • General

    • Enable thermal runaway monitoring.
      • When enabled if temperatures exceed configured maximums enabled relay will be powered off.
      • Max Bed Temp
        • Maximum temperature bed can reach before automatic power off is triggered.
      • Max Extruder Temp
        • Maximum temperature extruders can reach before automatic power off is triggered.
    • Error Event Monitoring
      • When enabled if printer reports an error relays with the option enabled will be automatically powered off.
    • Disconnect Event Monitoring
      • When enabled if printer becomes disconnected relays with the option enabled will be automatically powered off.
    • Upload Event Monitoring
      • When enabled auto power on enabled devices when file is uploaded to OctoPrint with the option to automatically start printing.
      • Include uploads via web interface
        • Enable to auto power on when uploading via the web interface rather than from a Slicer with the option to automatically start.
        • Automtically start print after on
          • Enable to automatically start the print after the Tasmota device is powered on and printer auto connects.
    • Connect Event Monitoring
      • When enabled auto power on enabled devices when the Connect button is pressed in OctoPrint.
    • Enable polling of status.
      • When enabled the status of relays will be checked based on the Polling Interval supplied.
      • Polling Interval
        • How many minutes between status checks of all relays when polling is enabled.
    • Cost per kWh
      • Amount used to multiply total kWh by to estimate power cost. Leave 0 if you do not have a power reporting device.
    • Request Timeout
      • How many seconds to wait for responses from tasmota device before it is considered offline.
    • Enable debug logging.
      • Report additional information in plugin_tasmota_debug.log for troubleshooting.
    • Power Off on Idle
      • Automatically power off all relays with the option Off on Idle enabled after configured idle timeout, target tempoerature is reached, and timelapse is completed.
      • Abort Power Off Timeout
        • Pop up will be displayed for this amount of time in seconds to allow for delaying power off of relays.
      • Idle Timeout
        • Amount of time that will lapse before printer is considered idle and relays will be powered off.
      • Idle Target Temperature
        • Power off will be delayed until all heaters reach this temperature.
      • GCode Commands to Ignore for Idle
        • Comma separated list of gcode commands to ignore for determining printer idle state.
      • Wait for Timelapse
        • When enabled idle power off will wait for timelapse to complete before powering off. Uncheck this to not wait, helpful for very long prints and timelapse rendering.
  • Device Specific

    • IP
      • The ip or hostname of tasmota device.
    • Index
      • Index of the relay, specifically used for multiple plug relay devices. Leave blank for single relay devices.
    • Label
      • Name to display on hover of the navbar button.
    • Username
      • Username to connect to web interface. Currently, not configurable in Tasmota, use the default username admin.
    • Password
      • Password configured for Web Admin Portal of Tasmota device.
    • Verify
      • Use this button to make sure that the plugin can communicate with your Tasmota device.
    • On Color
      • Color to display when device is on.
    • Off Color
      • Color to display when device is off.
    • Unknown Color
      • Color to display when device status is unknown.
    • Icon Class
    • LED
      • Is an LED or WS2812 type device connected, enter brightness value as percentage.
    • Sensor Identifier
      • Sensor identifier for connected sensors, ie DHT11 or BME280
    • On with Upload
      • Automatically power on when file is uploaded with the option to start printing automatically.
    • On with Connect
      • Automatically power on when pressing Connect button.
    • Off on Idle
      • Automatically power off when printer is idle.
    • Thermal Runaway
      • Power off if temperature exceeds configured max temperatures.
    • Off on Error
      • Automatically power off this relay when Error Event Monitoring is enabled.
    • Off on Disconnect
      • Automatically power off this relay when Disconnect Event Monitoring is enabled.
    • Auto Connect
      • Automatically connect to your printer after configured delay from power on.
    • Auto Disconnect
      • Automatically disconnect from printer and then power off relay after configured delay.
    • Warning Prompt
      • Prompt for confirmation before powering off via the navbar button.
    • Warn While Printing
      • Prompt for confirmation before powering off when a print is active.
    • Use Countdown Timers
      • Use Tasmota's built-in countdown functionality to offload the power operations. Helpful for safe shutdown of pi.
      • On Delay Countdown
        • Amount of delay in seconds for powering on device.
      • Off Delay Countdown
        • Amount of delay in seconds for powering off device.
    • GCODE On / Off Trigger
      • When checked this will enable the processing of M80 and M81 commands from gcode to power on/off plug. Syntax for gcode command is M80/M81 followed by hostname/ip and index. For example if your plug is 192.168.1.2 and index of 1 your gcode command would be M80 192.168.1.2 1
      • GCODE On Delay
        • Amount of delay in seconds before powering on device.
      • GCODE Off Delay
        • Amount of delay in seconds for powering off device.
    • Run System Command After On
      • When checked will run the system command configured in setting below after sending on command to device.
      • System Command to Run
        • System command to run after the on command is sent to device.
      • Delay
        • Delay in seconds before system command is run.
    • Run System Command Before Off
      • When checked will run the system command configured in setting below before sending off command to device.
      • System Command to Run
        • System command to run before the on command is sent to device.
      • Delay
        • Delay in seconds after system command is run before powering off device.

Examples

  • Pi Safe Shutdown Pi Safe Shutdown With these options the raspberry pi will be shutdown 5 seconds after the idle timeout is reached (as configured on the main settings page) and send a backlog command to your Tasmota device to power off after a 60 second delay.

Most recent changelog

1.0.4 (07/31/2021)

  • fix bug with M150 command not having I parameter causing the command to get lost in the queue, #143
  • make request timeout configurable in settings, #142
  • add numeric StatusSTS messages for chk values, #150
  • M118 support for LED commands for more real-time control based on what's happening on the printer (ie waiting for heat up). The function is similar to the M150 support but you will need to use the command M118 TASMOTA_M150 I192.168.0.105 R### G### B### W### P###
  • account for energy data with multiple relay device, #155

Get Help

If you experience issues with this plugin or need assistance please use the issue tracker by clicking issues above.

Additional Plugins

Check out my other plugins here

Sponsors

Support My Efforts

I, jneilliii, programmed this plugin for fun and do my best effort to support those that have issues with it, please return the favor and leave me a tip or become a Patron if you find this plugin helpful and want me to continue future development.

Patreon paypal

No paypal.me? Send funds via PayPal to [email protected]

octoprint-tasmota's People

Contributors

cp2004 avatar dependabot[bot] avatar dominikpalo avatar jneilliii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

octoprint-tasmota's Issues

No tasmota editor

Since 0.8.9 I don't have the possibility to access the Tasmota Editor....
The tasmota settings panel in plugins is nearly empty.
I tried to uninstall and reinstall it.
Refresh with ctrl+f5.
Restart the raspberry and shutdown and start.
2020-02-20 18_03_09-Window

Option to use backlog for delays

First of all thanks for your work and your great plugins.

Problem:
I would like to use "sudo shutdown now" to turn off my Pi and than kill the power.
From my understanding the delay used in the Plugin lets the Pi wait and than call the Power OFF command.
I would prefer or have the option to use Backlog and let Tasmota handle the delay.

Solution:
That would look like this:
<IP>/cm?cmnd=Backlog%20Delay%2050%3BPower1%20OFF
for a 5 second delay before powering off

More on Backlog:
https://github.com/arendst/Tasmota/wiki/Commands#using-backlog

Thank you :)
Max


Edit: Sorry just had a look at the code (not a JS-Guy) and f you allready seam to use it so might also be user error

[Feature request] Add auto shutdown after idle time and nozzle temperatur

Hi!

Very nice plugin, it is working great with my Sonoff device. But I have a little feature request. On another Octoprint instance I am using the plugin "PSU Control", which has the capability to turn off the printer automatically after a certain amount of idle time in conjunction with a specified nozzle temperature, so that you can say "turn the printer off after 5 minutes, but, in any case, wait for the nozzle to cool down to 50 degrees".

It would be really great, if you could add this timer feature, too.

Regards,
Holger

username and password

Hi,

It doesnt work if i use user and password

I get this from the URL: Need user=&password=

Readme doesn’t explain all options

Hi,

The README doesn’t say what the “Thermal Runaway” checkbox does, nor “Use Countdown Timers”, along with the 4 options on the main settings page (thermal runaway monitoring, debug logging, single relay device, status polling). I think it would be great if some explanations were given.

Thanks!

Read tasmota sensors.

Qould be posible to read tasmota sensors, like temperature an humisity and show them in navbar, like enclosure pluging?

Feature: Cancel shutdown, if printer is currently printing?

I can't spot this option, and it's a huge problem for me.

I would like to have a feature, which skips the "Power Off" command, if another print is ongoing.

If i fx has generated a GCODE, and forgot that M81is in the end, it's triggered after the print is done. I then, starting the next print, and 10 minutes after, it's turning off :( (I have a delay defined to 10 minutes, so my Pi can render my timelaps before).

So, an option for "Cancel Turn-off, if printer is currently printing"

And maybe even "Extend the Turn-off, if the printer is still processing timelaps" or so? :D

I've considered to just stop using this plugin, and implement all the things in Node Red, however, i like that the logics are within my OctoPrint-env :-)

Graph values are completely off

Hi,

thank you for this great plugin.
But i've a problem - the graph values are completely off. Here you can see a screenshot for one printjob. the powersocket (Gosund SP111 v1.1 - Tasmota 8.2) shows me at the powermeter values between 40-280W during the print time. Your pluginbs graph shows only this:

image

Can you help me?

Sonoff with only 1 Switch can't be used in GCode Scripts

Sonoff with only 1 Switch can't be used in GCode Scripts

When you setup a wemos/esp device with tasmota 6.6.0.5 and have only one switch on it , is cant be used by gcode-scripts (before printing / after successful print) in octoprint.
It just does nothing ...
The Button works fine in Octoprint.

Wenn man einen Wemos d1 mini oder andere esp-basierte chips mit tasmota 6.6.0.5 verwendet und man hat nur einen schalter, kann dieser nicht in den scripten von octoprint verwendet werden.
Der Befehl ist in der Konsole sichtbar, aber wird nicht ausgeführt.
Der Button in der Titelzeile von Octoprint funktioniert ohne Probleme.

Toggle is very slow

Hi there,
What a great addition to octoprint! This way I can automatically switch off the printer after use and save 17 Watts of power!

The plugin seems to do what it should for me, but the toggle is often very slow. Sometimes it takes up to a minute or so before the printer is turned on after I press the lightning bolt icon in the toolbar. If instead I go to the device's tasmote page and press the on (or off) toggle there, the effect is instant.

Am I doing something wrong, is there a way to troubleshoot the delay?

password field readable

Hi there

It looks like the password field is readable what leads into a security issue.
grafik

Do you mind to please make the password field unreadable?

Thanks!

Regards
Vince

Status Polling

Nice piece of code, this plugin. But would it be possible to somehow update the status? If after printing the Sonoff is switched off by the G-code sequence, and I want to print something else later, I have to reload the complete octoprint page, since otherwise it does not know that the Sonoff is off and not on. The green icon remains, and there is no way to make it turn red, other than reloading the page.
Could there be an update option, or even some auto-update mechanism that checks the Sonoff status every now and then?

Gcode auto on/off not working?

Not sure if I'm missing something but after reading the setup page many times, from my understanding is I just put the PI of the sonoff after the M80 or M81 Command in the script for before and after printing. if I'm getting this wrong please someone explain this to me.

Icon Ref issue

The link to Font Awesome icons is not correct the correct one should be
https://fontawesome.com/v3.2.1/icons/
as you are using Font Awesome 3.2.1 and does not have the latest icons you display in the link you added, this also have other format of css class "fa-plug", you could change the link or update the Font Awesome library to the latest for better icon compatibility or maybe change to material icons.

behaviour of tasmota replies changed

Hi,
tasmota is reporting status in lower case , in the plus in its checked against upper case

9-06 11:10:03,405] DEBUG: {u'command': u'disconnectPrinter'} [2019-09-06 11:10:03,406] DEBUG: Disconnecting printer. [2019-09-06 11:10:03,557] DEBUG: {u'username': u'admin', u'idx': u'1', u'ip': u'192.168.100.39', u'command': u'turnOff', u'backlog_delay': 0, u'password': u'2cool4u'} [2019-09-06 11:10:03,561] DEBUG: Using authentication for 192.168.100.39. [2019-09-06 11:10:03,565] DEBUG: Turning off 192.168.100.39 index 1. [2019-09-06 11:10:03,614] DEBUG: Response: {u'POWER1': u'off'} [2019-09-06 11:10:03,616] DEBUG: {u'POWER1': u'off'} ^C

Problem with idx or pw?

  • plugin v 0.5.0
  • idx testet with 1 or empty
  • pw empty in plugin and tasmota
  • tasmota v5.11.1a

Here my log:
[2018-01-12 15:36:32,169] DEBUG: {u'username': u'admin', u'ip': u'192.168.99.24', u'password': u'', u'command': u'checkStatus', u'idx': u''}
[2018-01-12 15:36:32,170] DEBUG: Using authentication for 192.168.99.24.
[2018-01-12 15:36:32,170] DEBUG: Checking status of 192.168.99.24 index .
[2018-01-12 15:36:32,195] ERROR: Invalid ip or unknown error connecting to 192.168.99.24.
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_tasmota/init.py", line 132, in check_status
webresponse = urllib2.urlopen("http://" + plugip + "/cm?user=" + username + "&password=" + password + "&cmnd=Power" + str(plugidx)).read()
File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 437, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 550, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 475, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 558, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 401: Unauthorized
[2018-01-12 15:36:32,199] DEBUG: 192.168.99.24 index is UNKNOWN
[2018-01-12 15:36:32,200] DEBUG: unknown error with 192.168.99.24.

any ideas?

Status Icon

When I enter Octoprint, I can se the power indicator, and if it's off it goes 1 second red and then goes gray again, if it's green the same thing happens, it goes green then gray, clicking on the power icon does not work, it randomly works some times, when clicking i'm getting a 204 No Content, if i execute the comand directly from the browser the unit works, but from OctoPrint it works sometimes only.
screenshot_1

Auto power off

HI. Is it possible to turn off the printer automatically after printing?

turn off printer after print has finished

Hi,
first of all thanks for this awesome plugin!

Power on/off from the GUI works fine so far!

My goal is to automatically power off the Printer after completing a print. I didn't find a solution inside the documention except for M80/M81.

Can't I simply use the internal octoprint print status to power off the printer some how?

I hope my question is not too dumb.

Edit: what does "Print Complete Off" do? It's also not mentioned inside the Documentation.

Latest Version Breaks Existing Configuration

Just auto updated to the latest version and Tasmota has stopped working. Was working before the update so configuration was correct.

Have confirmed the IP address is correct and index is one. I have a simple Sonoff Switch.

Cheers

Status unknown since last update

Tasmota 0.8.10
OctoPrint 1.4.0

Hey, first of all thanks for the development :)
Since the last update my Sonoff S20 with Tasmota has a problem showing me the correct status. An error message appears.

"Status unknown for 192.168.177.230. Double check IP Address\Hostname in Tasmota Settings."

I have to set the index to "1" to be able to switch the power socket via GCode. If I delete the index, the status display works perfectly, but I can't switch the power outlet by GCode anymore.

feature: Disable icon button

I do not use this plugin, I only have it as a dependency for the auto shutdown and tplink, so now i have this useless spinning question mark that i do not need. Please allow this to be disabled.

Screen Shot 2020-01-01 at 8 22 49 AM

Turn automatically on.

Is it possible to turn on the Printer when i´m starting a Printing Job ? And afterwards off ?

Single-shot shutdown-after-print button

Often, I start a print, and then realize that it will take longer than anticipated, and I would like to shutdown my printer after it finishes.
Now, I add a G-code to my slicer output file via the Slic3r config, and it makes the printer shutdown afterwards. I can also add that via Octoprint. But in both cases, it's set for that print and if I didn't set it, the printer stays on.
My idea would be to make an overrule button, that can either leave what's configured, or shutdown the printer when the print is finished, or leave it on (even if the G-code tells to shut it down). And then after doing its jobs (when the current print had finished), the button should restore to its original (neutral) state.
Could that be an option to add to OctoPrint-Tasmota(MQTT)? I think it should belong there, and not in a separate plugin, since it only makes sense if you have an automated power switch like a Tasmota.

will not connect now after update

hi, after update will not connect using the ip address. can log onto the sonoff using ip address and toggle.
Have tried combinations of index , but reading notes should be one. firmware updated on sonoff. have another printer on the older version. how do i roll back to previous version?

Button

Hi...

i see no Button/switch after config the plugin... where is the button....

thanks jürgen

Current status

I would like to know if this plugin is currently operational, i have been looking at the code and where you send the request to "tasmota" you are using "ip + /plugin/tasmota" + payload parameters, and i have been looking at the tasmota and only see MQTT integration and HTTP request and they look like this

http://sonoff/cm?cmnd=Power%20TOGGLE
http://sonoff/cm?cmnd=Power%20On
http://sonoff/cm?cmnd=Power%20off
http://sonoff/cm?user=admin&password=joker&cmnd=Power%20Toggle

Tasmota Commands

do i have to use any custom tasmota firmware or something?

Thanks.

Unable to switch on my light

Hi - first of all thanks for creating this plugin. It is exactly what I needed. I have a Sonoff Basic flashed with the latest tasmota firmware. It connects to my network and I'm able to switch it on / off using the web interface at IP address 192.168.1.225.
However, whenever I try to use the plugin, I get the following error:
screen shot 2017-12-30 at 09 51 24

Not sure what to do. Thanks for you help.

turn off the printer

Hi, first of all thanks a lot for the great plugin. I tried to control my Tasmota socket to turn off the printer when i shut down octoprint but unfortunately it does not work. probably i am using the wrong command. i would be very grateful for some information. best regards Alex

Setup missing

After installing Tasmota plugin i can not configure it properly. E.g. the 'user' and 'password' setting is missing. Can it be specific to my OrangePi Zero or the readme pictures are outdated?

screenshot from 2018-02-24 10-20-16
screenshot from 2018-02-24 10-20-04

GCode off delay not working

I've set my GCode off delay to 20 seconds and the off command works great, but the delay function does not. It's not a huge deal but I also use the Telegram plugin to monitor my prints and the final picture when sent is black because my Tasmota controls the light above my printer. Please help me troubleshoot a fix.

Not working with my TP Link HS110

Hi,

I cannot get the plugin working with my TP-Link Smartplug HS110.

TP-Link Smartplugin is working, but Tasmota is not getting the connection while using the very same settings. Any hint how to get it working?

[Request]: Incorporate Status Polling

Something i found..

The Tasmota plugin, doesn't get the reply from tasmota switch:
like:
{"POWER":"OFF"}
{"POWER":"ON"}

I have turned off in all my tasmota Switches:
Web-Log Level
to level 0

So there's no reply for web...
Now i turned to Level 1 (INFO) all works fine..
;)

No Script error. Configuration Error at sonoff tasmota switch by User (me)

If Using Sonoff RF, check 1 Relay in plugin Config or leave Index empty.
I don't set 1 Relay, because using also sonoff 4chpro with index 1-4 at samt time.

Sorry.. for fast german englisch...

Tested sonoff rf & sonoff 4chpro

may be nice the Status of Switches may be polled some time,
if somone using parallel rf 433mhz remotes :-D


Was habe ich herausgefunden...
Das Tasmota plugin, bekommt nicht die erwartete Antwort vom Tasmota Schalter, wie z.B.:
{"POWER":"OFF"}
{"POWER":"ON"}

Ich habe aus gewohnheit, direkt immer überall auf den Tasmota Schaltern
das Logging fürs Web ausgechaltet...

Einstellungen->Logging konfigurieren->Web-Log Level
Level 0 = keine
Somit gibt es dann im Web auch keinerlei Rückmeldungen....

Nachdem ich dieses nun auf den Level 1 (INFO) umgestellt habe, funktioniert alles wie
erwartet.
Der Fehler lag nicht beim Script sondern beim User der das Einstellte (ich)... ;-D

Bei dem Sonoff RF, entweder den haken: 1 Relay in der Plugin Config setzen oder das Index Feld leer lassen.
Ich habe den haken bei 1 Relay weg gelassen, damit ich parallel ebenfalls einen SONOFF 4CH PRO steuern kann mit Index 1-4

Tested sonoff rf & sonoff 4chpro

Meine Sonoff Daten
Version:


Tasmota Version
6.6.0(release-sonoff)
Build-Datum & -Uhrzeit
2019.07.06 13:17:19
Core-/SDK-Version
2_3_0/1.5.3(aec24ac9)


Meine Plugin Daten
Tasmota (0.8.5)
Simple plugin to control sonoff devices that have been flashed with Tasmota.

Originally posted by @TheDiNi74 in #10 (comment)

[Request] Can no longer use hostname, MUST use IP

OctoPrint-Tasmota version: 0.8.10
OctoPrint version: 1.4.0

Recently updated, had to reconfigure, and found I could not longer throw in my assigned hostname into the plug configurator because it explicitly checks for IPs, here and here.

I usually don't assign fixed IPs to my IOT devices and instead just let my DNS setup handle stuff like this, so this is a tad annoying for this workflow.

Is there a chance to get back support for both IPs and hostnames here? :)

Assing a label and Icon.

It would be grat if could be posible to asing a name and an icon for diferent things like lights

Possible to launch a shell script afetr On/Off ?

Hi,
I use Tasmota plugin to start my printer. As I have a webcam and a led bar, I'd be able to use the 'run system option' at start and stop.
I put the command 'sudo service webcamd start' and 'sudo service webcamd stop' as system commands abd it's work fine to start and stop my webcam.
To be able to manage also my leds, I write a script :

#!/bin/bash

#vérification si accès root
echo $(id -u)
echo $1
if [ "$(id -u)" != "0" ]; then
    echo "Il faut être root pour exécuter le script."
    echo "Usage: sudo `basename $0` [start/stop]"
    exit 1                                            #sortie
fi                                                  #fin if

#vérification passage de paramètre stop/start
if [ "$#" -ne 1 ]
then
    echo "paramètre attendu"
    echo "Usage: sudo `basename $0` [start/stop]"
    exit 1
fi
if [ $1 != 'start' ] && [ $1 != 'stop' ]
then
    echo "mauvais paramètre passé"
    echo "Usage: sudo `basename $0` [start/stop]"
    exit 1
fi

# Set up GPIO 4 and set to output
#echo "4" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio4/direction

if [ $1 == 'stop' ]
then
# Write output
    echo "1" > /sys/class/gpio/gpio4/value
    sudo service webcamd stop
fi
if [ $1 == 'start' ]
then
    echo "0" > /sys/class/gpio/gpio4/value
    sudo service webcamd start
fi

That script works fine when launched directly on the rpi connected via ssh (command : sudo /home/pi/scripts/Led_Webcam.sh start) but nothing happens when putting the same command into tasmota...
image

What's wrong ?

Why SetOption26?

This is just a question. Why does the plugin need the plug to have the 26 option enabled? If it is enabled, home assistant isn't capable of updating the switch's state anymore.

Plugin causing unnecessary octoprint server reloads

Octoprint always asking to reload to update server.

"Please reload
There is a new version of the server active now, a reload of the user interface is needed. This will not interrupt any print jobs you might have ongoing. Please reload the web interface now by clicking the button below."

I believe this is because the Power data is saved in a label in the octoprint config.yaml. AFAIK when the config.yaml gets updated it requires a reload of octoprint.

tasmota:
_config_version: 7
arrSmartplugs:
- autoConnect: true
autoConnectDelay: 10
autoDisconnect: true
autoDisconnectDelay: 0
automaticShutdownEnabled: true
backlog_off_delay: 0
backlog_on_delay: 0
currentState: 'on'
displayWarning: true
gcodeEnabled: false
gcodeOffDelay: 0
gcodeOnDelay: 0
icon: icon-bolt
idx: '1'
ip: 192.168.1.167
label: ''
label_extended: '
ApparentPower: 187.342
Power: 83.2
Yesterday: 0.785
TotalStartTime:
2020-01-03T00:00:00
Current: 1.556
Voltage: 120.4
Factor: 0.44
ReactivePower:
167.9
Total: 84.488
Today: 1.271'

Power off on print complete

It would be nice if there was a checkbox under the print status in OctoPrint that would let you automaticaly turn off the power once the print has successfuly finished, this could be checked on every print so if you need tu turn off the power once it’s finished, if it’s checked it would be nice once the print is finished to open a dialog with a 10 second countdown so in case you want to cancel the power off, if you dont cancel it in 10 seconds it would power off automatically.

port

My sonoff is configured with a port, ie 192.168.1.20:2020, but it does not seem to work with this plugin, as I get the message on Octoprint that the device statsu is unknown.

No status with sonoff 4ch 6.6.0 - ERROR: Invalid ip or unknown error connecting to

Hi

Getting this from logs but I can ping this device ok. Any obvious ideas please? Or anything further to test?

Plugin 0.8.6 on Octoprint 1.3.11

PING 192.168.21.93 (192.168.21.93) 56(84) bytes of data.
64 bytes from 192.168.21.93: icmp_seq=1 ttl=128 time=4.18 ms
[2019-10-17 00:29:25,766] ERROR: Invalid ip or unknown error connecting to 192.168.21.93.
Traceback (most recent call last):
  File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint_tasmota/__init__.py", line 158, in check_status
    chk = response["POWER%s" % plugidx]
KeyError: 'POWER'
[2019-10-17 00:33:33,720] ERROR: Invalid ip or unknown error connecting to 192.168.21.93.
Traceback (most recent call last):
  File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint_tasmota/__init__.py", line 158, in check_status
    chk = response["POWER%s" % plugidx]
KeyError: 'POWER'
[2019-10-17 00:33:37,976] ERROR: Invalid ip or unknown error connecting to 192.168.21.93.
Traceback (most recent call last):
  File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint_tasmota/__init__.py", line 158, in check_status
    chk = response["POWER%s" % plugidx]
KeyError: 'POWER'

Move System Commands and Connect/Disconnect logic to python code

In order for future changes to Cura plugin for auto-powering on plugs need to change the auto-connect logic to the python side instead of the javascript side. While doing so, might as well do the same for disconnect and on disconnect commands as well. Also, need to make backlog_delay parameter optional in api calls.

Version 0.4.0 not working with firmware 5.9.1i

After a couple of months of happily working, version 0.4.0 no longer works with my firmware 5.9.1i Sonoff Basic.

Sonoff Basic does not have a password set.

Debug log from plugin:

[2018-01-12 21:21:29,309] DEBUG: {u'username': u'admin', u'ip': u'192.168.1.52', u'password': u'', u'command': u'checkStatus', u'idx': u''}
[2018-01-12 21:21:29,312] DEBUG: Using authentication for 192.168.1.52.
[2018-01-12 21:21:29,315] DEBUG: Checking status of 192.168.1.52 index .
[2018-01-12 21:21:30,531] DEBUG: 192.168.1.52 index  response: RESULT = {"POWER":"ON"}
POWER = ON (retained)
[2018-01-12 21:21:30,535] ERROR: Invalid ip or unknown error connecting to 192.168.1.52.
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_tasmota/__init__.py", line 134, in check_status
    response = json.loads(webresponse)
  File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
[2018-01-12 21:21:30,551] DEBUG: 192.168.1.52 index  is UNKNOWN
[2018-01-12 21:21:30,553] DEBUG: unknown error with 192.168.1.52.

Log from Sonoff (I've redacted the MAC address):

05:21:24 MQT: tele/sonoffbasic1/STATE = {"Time":"2018-01-13T05:21:24","Uptime":528,"Vcc":3.180,"POWER":"ON","Wifi":{"AP":1,"SSId":"salt","RSSI":84,"APMac":"**:**:**:**:**:**"}}
05:21:30 MQT: stat/sonoffbasic1/RESULT = {"POWER":"ON"}
05:21:30 MQT: stat/sonoffbasic1/POWER = ON (retained)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.