I’ve got a motorized sunshade on my porch connected to a Qubino Flush Shutter z-wave module and I would like to be able to see the position of the shade in the HASS UI using a slider. I’ve got three buttons to control the shade (up/stop/down):
I tried accessing the states.cover.markis_level but although the debug tool shows there is a current_position value, HASS won’t let me access it but rather throws a big exception in my face: jinja2.exceptions.UndefinedError: 'homeassistant.core.State object' has no attribute 'current_position'
Right, I finally found some time to sit down with my automations. I’ve managed to tweak @firstof9’s scripts above so that the input_slider updates according to the cover position but I can’t get my head around the opposite, controlling the cover with the slider. I’ve tried 10’s of different templates but no matter how I do, I get an error message and the cover doesn’t move.
gives this error message: Invalid service data for cover.set_cover_position: extra keys not allowed @ data['value']. Got '20.0' required key not provided @ data['position']. Got None
Using value: '{{trigger.state}}' as suggested above gives a similar error but with no value: [homeassistant.core] Invalid service data for cover.set_cover_position: extra keys not allowed @ data['value']. Got '' required key not provided @ data['position']. Got None
As can be seen in the error message, {{ states.input_slider.cover_position.state }} obviously returns a float value, how come it’s not accepted?
kind of works after I added the integer conversion, it doesn’t throw any errors at me when starting HASS but on the other hand the sun shade doesn’t move like it should. When I change the slider value the cover starts to move (in the right direction, let’s say inwards), then stops after just a few centimeters, goes back out a few cm, stops, goes in, stops, goes out, stops.
I guess there is some conflict between the setpoint and current position as I’m using the same slider for both values?
Hi, sorry for the delay, I didn’t get a notification for your reply.
Can’t access my HA right now, but I remember that I adapted this example:
in my case the RF part was resolved using pilight-control (the cover was first configured in pilight, so I can access pilight web interface in case of HA failure). Just send at the same time the 433MHz command to your cover and call the script “states.sh”
I lately configured the detection of the original RF remote buttons, so HA knows when somebody open/close the cover manually.
Would you be so kind and let us know your whole setup for the RF? Also how are you sending the command to cover and calling the script at the same time, do you use the commandline cover? Thanks
Hi all.
I’ve tried a similar solution, but when i use the slider to set the level, the cover start moving but stop itself istantly, probably because when start moving it sends its level, set the slider, then the slider re-set the cover level and stops.
I use a slider for volume, and it always sends a double signal but still works as expected. The only way I can think of that can get you around this issue would be to write your automation in appdaemon. When I ported the volume slider automation into appdaemon, I was able to set flags to ensure that the slider didn’t send more than 1 service.