JohnvandeVrugt / toonapilib4domoticz

A simple toonapilib based python plugin for domoticz
MIT License
7 stars 6 forks source link

Support program (in)active #7

Closed JohnvandeVrugt closed 5 years ago

JohnvandeVrugt commented 5 years ago

The TOON app does have a switch to turn of the automatic program. So if the program is being run, TOON follows the selected state. But if the program is inactive, TOON shows what state is selected, but it will not execute it, untill the program is set to active.

stephanvdplas commented 5 years ago

This issue should not be closed yet, is is not solved with tal4d 1.0.9 and toonapilib 3.0.10. Torning off the program on the Toon app stops changing the states programmatically, but does not change the working of the states themselves. Setting and reading the states should be working regardless of the program on/off state, which is not the case at this moment. When stopping the program, a state 0 is now seen in the Domotics Toon selector device. The other way around: setting a different state from domoticz works (also when the Toon program is switched off) but the selector directly goes to state 0 again so the domoticz selector device does not present the set state but state 0 (holiday). This might be an API bug, but maybe we can work around this in one or other way?

JohnvandeVrugt commented 5 years ago

Stephan,

Use the latest update: with the program off, you can set the thermostat state and TOON will follow. If you have the automatic program active I have seen that you cannot change the state propery. I have reported this to the toonapilib developer.

stephanvdplas commented 5 years ago

I'm sorry to report that on the latest versions of ToonApiLib, Toonapilib4domoticz and the latest beta of Domoticz it is not working. Setting the state of the selector in domoticz to 10, 20, 30 or 40 does set the Toon to the corresponding state. But after a while (something less than 5 minutes) the state of the selector is set back to 0. The Toon is functioning, but the state of the selector should reflect the state of the current setting of the Toon, despite the program being switched off. This I think is a bug in the API itself.

JohnvandeVrugt commented 5 years ago

Stephan,

the issue should be solved now: https://github.com/costastf/toonapilib/pull/25

stephanvdplas commented 5 years ago

I'm sorry to report my issue is still there. I upgraded to toonapilib 3.1.0 and did a couple of tests: Setting the selector to Home --> Toon is set to home (program is still off) which is correct --> after a minute, the selector is set to level 0 again which is imho not correct.

JohnvandeVrugt commented 5 years ago

Stephan, that's weird. I cannot reproduce it. Meanwhile I discovered that pip3 does not always install the latest library unless you add -U to the command. I also added some logging to my latest plug-in version that reports the toonapilib that is used by the plug-in. Just to make sure that we do not fight bugs that have been fixed. Do you also use the latest version of my plugin?

darkrain-nl commented 5 years ago

Do you also use the latest version of my plugin?

Perhaps is it a good idea to start using the release mechanism of Github? That way it should be a little easier to see when their is a new release. Having that said, I have no idea how this works exactly ;-)

stephanvdplas commented 5 years ago

Hello all, with he newest version (3.2.0) of the toonapilib and the latest plugin.py the issue has been solved. I don't know for sure which of both components pulled the trigger, but hey, who cares! I thank you both @darkrain-nl and @JohnvandeVrugt !

JohnvandeVrugt commented 5 years ago

Added support for program state in plugin amongst lot of other stuff. Checkout release 1.0.14.