Open simo26246 opened 6 years ago
Any luck with this?
Nah, I gave up - couldn't figure out how to get it to send it with a retain flag. In addition, I couldn't get home assistant to extract the position value, rather than set - even parsing json in a template.
What I did to get around it is change the orientation of up and down in home assistant, so at night when the blinds are down (which the program thinks is up) I can turn the power off. That way, at least it saves power for a bit of it, then, when it relaods, it thinks its up so will go down without having to recalibrate. I've got solar panels too, so using electricity in the day isn't such a concern for me.
Sorry I couldn't be more help.
Hi, sorry for the lack of response. I'll take a look at it
Much appreciated. Will be interested to see your solution!
I fixed it in my pull request about half a year ago. Please look there. [edit] the issue was caused by inproper handling of JSON file.
@marecl Thank you, your PR worked a treat!
Hi there, first, let me say thank you for this. I've been looking for something similar for several months now. I had resigned myself to using servos, which was VERY hit/miss with respect to the position it opened to/stopped at plus, was an all or nothing (up/down).
Now that I've got this all up and running, when it loads back up, and I restart the web interface, it doesn't load its previously saved 'current position'. I query whether this is due to the fact that the mqtt messages aren't being retained? But honestly, have no idea about how to start looking at this!
This wouldn't be a problem, but for the fact that I kill the power to them when they are down (ie - at MAX). If I killed it when they're up, it saves the relative position fine and once I put it up, it goes down fine, but want it to think it starts at 100, rather than 0.
Hope that makes sense -
Here's a copy of the code from serial monitor:
then I kill power, then this pops back up:
Any help/guidance would be appreciated.
EDIT: upon further invesitgatin, I can confirm that the MQTT message of current position is not being saved (I'm not sure how to get it to store/load dictionary values?). When it reboots, it loads up as if it is at position 0. Any idea how I can get this to be retained by the mqtt server, or, upon reboot, get it to send a msg { "set":(retained value), "position":(retained value) } so the output is 'stopped motor, reached desired position' which effectively resolves my issue?
Alternatively, some way to program deep sleep into it, so it doesn't pull through so much power?