edekeijzer / OctoPrint-PSUControl-Shelly

GNU Affero General Public License v3.0
10 stars 6 forks source link

Can not switch Shelly Plug S #2

Closed KristofKlein closed 3 years ago

KristofKlein commented 3 years ago

Hi,

so happy you made this Plugin! Unfortunate I can not use it - or miss something how to set it up.

Scenario: Plug is On - RPI with Octoprint is on. State of PSU Control is "Off".

So I press the on button in the UI (it turns green): 2021-05-18 09:39:37,821 - octoprint.plugins.psucontrol - INFO - Switching PSU On

assuming this is ok - try to press the off button: 2021-05-18 09:39:51,163 - octoprint.plugins.psucontrol - INFO - Switching PSU Off 2021-05-18 09:39:51,164 - octoprint.plugins.psucontrol_shelly - INFO - Still in transition between sending and receiving change, not sending command.

and this happens to be like that until I restart octoprint...

Using local network: confirmed URL and password are ok via curl url + -u user:pswd from the PI ... so switching works.

Actually I'm in a container - but also there it worked fine with curl.

looked a bit in your code: when is self.transition set to False after a command was send? Or when is get_psu_state called?

as I do not get any further logs my guess is I'm stuck at: response = requests.get(url, auth=auth) - does this thing support a timeout?

Some help would be nice :)

JimlyTheReal commented 3 years ago

Hi thnx for the Shelly Plugin - its great, but i'am sorry, I have the same problem detected as the entry in front of me has described !

My configuration:

=> Only one time OctoPrint toggled the Shelly on, if OctoPrint was started. Then fhe function died! After reboot your function does not switch off the Shelly, you may switch it otherwise off, then the first klick on the PSU "flash" switched it on....

I tested outside OctoPrint PSU Plugin with curl from the Console of a PC or via ssh from the OctoPi:

but not from your PSU plugin!

edekeijzer commented 3 years ago

@KristofKlein @JimlyTheReal did you set the Sensing method to the right plugin? This sounds like the status is not read from the Shelly.

JimlyTheReal commented 3 years ago

Solved, yes this was the trick! thnx @edekeijzer !!!!

edekeijzer commented 3 years ago

I'll look into displaying a warning if it's not correctly set. The author of the PSUControl plugin showed me how to display a warning if the psucontrol plugin isn't available at all.

KristofKlein commented 3 years ago

520EF7E9-124A-4360-9DB1-0E87C83237C5 I would say so. As the toggle in the UI also Leads to the message that it triggers the sending... logs don‘t lie 😄

KristofKlein commented 3 years ago

Hell No! There are two setups!

Than it might work :D didn't see that second one ... printing right now. would be bad timing to test :D

edekeijzer commented 3 years ago

Hell No! There are two setups!

Than it might work :D didn't see that second one ... printing right now. would be bad timing to test :D

I assume it will work then, but for clarity for future users, I built in a warning when the wrong switching/sensing method or plugin are selected. It'll be in the next release.

KristofKlein commented 3 years ago

Indeed! It works! Awesome!

edekeijzer commented 3 years ago

The warnings for these settings have been pushed as well, so I'll close this one.