OctoPod icon indicating copy to clipboard operation
OctoPod copied to clipboard

Tasmota broken

Open G3kid0 opened this issue 4 years ago • 26 comments

Hi, with the new version 1.5.0 / 1.5.1 of Octoprint the Tasmota control is broken. Can you fix this ? Thank you

G3kid0 avatar Dec 07 '20 12:12 G3kid0

Hi @G3kid0 , thanks for bringing this to my attention. Could you share more what is not working? Is it listing switches? getting their state? turning them on/off?

Thanks, Gaston

gdombiak avatar Dec 07 '20 17:12 gdombiak

image Buttons are grey and can't click it. Of course it work on web interface. Maybe because of the new version 0.8.16 of Octoprint-Tasmota plugin

https://github.com/jneilliii/OctoPrint-Tasmota/commit/c86efa5856a397b609929339e6a84f1921a7376c

Thank you

G3kid0 avatar Dec 07 '20 22:12 G3kid0

Thanks. That info helps. It seems like OctoPod is not able to know if the switches are on/off so it does not let you click on them. Will try it later tonight and see if I can add a fix for the next release

gdombiak avatar Dec 07 '20 22:12 gdombiak

Thank you !

G3kid0 avatar Dec 07 '20 22:12 G3kid0

Hi @G3kid0 , I do not have Tasmota plugs to fully reproduce your case. Could you log into OctoPrint and enable logging for Tasmota plugin using DEBUG level? Here is how I did it in my setup: Screen Shot 2020-12-07 at 7 51 38 PM

Once you did that:

  1. go to OctoPod and go to the panel where you see your Tasmota plugs.
  2. Wait a couple of minutes
  3. Go back to OctoPrint to Settings -> Logging and download the file plugin_tasmota_debug.log
  4. Attach it here so I can see if the plugin is having any errors
  5. You can remove the Logging Level that you added at the beginning if you want

I will keep testing locally in the meantime to see if I see something.

Thanks, Gaston

gdombiak avatar Dec 08 '20 03:12 gdombiak

Hmm, could you check out also the log file octoprint.log? I have the following error in mine that is causing the plugs to not be refreshed. I wonder if you see a similar entry.

2020-12-07 20:00:03,549 - octoprint.server.api - ERROR - Error while executing SimpleApiPlugin tasmota Traceback (most recent call last): File "/Users/gaston/repo/OctoPrintPython3/src/octoprint/server/api/init.py", line 146, in pluginCommand response = api_plugin.on_api_command(command, data) File "/Users/gaston/repo/OctoPrintPython3/src/octoprint/util/init.py", line 1909, in wrapper return f(*args, **kwargs) File "/Users/gaston/repo/OctoPrint-Tasmota/octoprint_tasmota/init.py", line 501, in on_api_command return flask.jsonify(self.check_status("{ip}".format(**data), "{idx}".format(**data))) File "/Users/gaston/repo/OctoPrint-Tasmota/octoprint_tasmota/init.py", line 462, in check_status return {"currentState": "unknown", "ip": plugip, "idx": plugidx, "energy_data": energy_data, "sensor_data": sensor_data} UnboundLocalError: local variable 'energy_data' referenced before assignment

You might have this error or maybe other errors. You can also attach octoprint.log here if you want and I can check it out

gdombiak avatar Dec 08 '20 04:12 gdombiak

Found the problem. The plugin now works differently so OctoPod no longer works. I will contact the developer to see if he is going to also change all his other plugins to work like this one. Depending on his answer I will know what to fix (if need to do something, maybe he will rever that change).

gdombiak avatar Dec 08 '20 04:12 gdombiak

Thank you for the reactivity ! Do you still need the log files?

G3kid0 avatar Dec 08 '20 06:12 G3kid0

I will look into putting the websocket communication layer back in later this week (maybe tomorrow after work), it's way too late for me right now (1:30AM). No changes on the OctoPod side should be necessary, but the Tasmota plugins will need to be upgraded once released.

jneilliii avatar Dec 08 '20 06:12 jneilliii

@jneilliii that's great to hear!!!! Thanks so much for being so accommodating.

gdombiak avatar Dec 08 '20 18:12 gdombiak

@G3kid0 no need for logs now. We got to the bottom of this. Thanks

gdombiak avatar Dec 08 '20 18:12 gdombiak

So since I don't have an apple device to test OctoPod and @gdombiak doesn't have a tasmota device to test the plugin I need someone to test to see if my 0.8.17rc1 version resolves this issue or not before I officially release. To test, if you are running OctoPrint 1.5.0+ you can change the release channel for the plugin in the software update settings by changing the Release Channel to Release Candidate otherwise you'll have to manually copy/paste the URL below into Plugin Manager > Get More > ...from URL and clicking Install. It should just install right over the existing version without any issues.

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

jneilliii avatar Dec 09 '20 19:12 jneilliii

Hi @jneilliii , I have the plugin installed in my dev environment and change the code that makes the actual call to the tasmota device to see how things work. I will give ti a try to the new version and let you know tonight how it worked in my local dev env.

gdombiak avatar Dec 09 '20 19:12 gdombiak

@jneilliii it seems that it does not work. More test and details tonight after work. Thanks for your work

G3kid0 avatar Dec 11 '20 02:12 G3kid0

@jneilliii I posted in this other issue the possible cause why 0.8.17rc1 is still not working with OctoPod.

gdombiak avatar Dec 11 '20 04:12 gdombiak

Wanted to let you guys know if you need help for testing this I could do it as well. I use OctoPod and tasmota switches.

vordenken avatar Dec 11 '20 09:12 vordenken

@jneilliii I've tested the RC, and confirm that it did not solve the problem.

dnasir avatar Dec 11 '20 21:12 dnasir

Hi, no news about this ? :/

G3kid0 avatar Dec 19 '20 00:12 G3kid0

Just now getting to the weekend, which is when I do most of my plugin work. Hopefully will have something new to test soon.

jneilliii avatar Dec 19 '20 01:12 jneilliii

I just put up an rc2 version if you guys could test and let me know. I basically added the websocket message back in the check status function @gdombiak, I hope that gets us back. Still unsure why adding them into the turn_on and turn_off commands wasn't working.

jneilliii avatar Dec 19 '20 02:12 jneilliii

@jneilliii Thank you, I tested the rc2, it seem to work. But now on Octopod there is an error message. @gdombiak image

G3kid0 avatar Dec 19 '20 05:12 G3kid0

you'll probably have to check the logs for errors. The only other change that may effect this is the permissions. I had to change the API permissions method due to future deprecation of the previous method. It should by default add the permissions to the admin group but if your API key is associated with a different user/group you'll have to adjust those permissions to allow control of tasmota.

image

jneilliii avatar Dec 19 '20 15:12 jneilliii

Hmm it changes the state of the switch but octopod shows the message @G3kid0 postet so i thing the problem is on the octopod side. If someone tells me what log files he need i can provide them

aSilentSniper avatar Dec 22 '20 21:12 aSilentSniper

I just pushed an update to the plugin that I think will allow OctoPod to work again. If you are already using the Release Candidate channel in Software Update for this plugin you should be able to just update to 0.8.17rc3. I misread what @gdombiak had told me in what OctoPod was expecting as a return code. I have now removed the 200 response codes so in theory should work the same as it did before the last update and give OctoPod what it expects to receive again without effecting the OctoPrint UI.

jneilliii avatar Dec 26 '20 20:12 jneilliii

0.8.17rc4 works for me.

vordenken avatar Dec 26 '20 22:12 vordenken

@jneilliii yes 0.8.17rc4 works for me too. Thanks

G3kid0 avatar Dec 27 '20 00:12 G3kid0