I got the new IKEA blinds and sucessfully paired them with deconz. I’ve set up a template sensor that shows the current state of openess of the blind (0-100%) called sensor.rollo_schlafzimmer_open_percent.
I have also set up an input_number (slider) that can be used to control the blinds called input_number.rollo_schlafzimmer.
Now I want to make this slider bidirectional e.g. when I use the blinds remote and put the blind into a new state the slider should adapt this value. The blinds take roughly 17 seconds to completly open or close. My plan is to monitor the value of my template sensor and when the value has not changed for 20 seconds the slider should be updated with the last value of the template sensor. Here is what I got so far. I have placed the delay as first action but for some reason it is ignored by the automation causing trouble with the automation to set the blind when the slider is updated:
- alias: Rollo Schlafzimmer Set Slider
initial_state: True
trigger:
- platform: state
entity_id: sensor.rollo_schlafzimmer_open_percent
action:
- delay: '00:20:00' #WHY IS THIS DELAY IGNORED?
- service: input_number.set_value
data_template:
entity_id: input_number.rollo_schlafzimmer
value: "{{ states('sensor.rollo_schlafzimmer_open_percent') | int }}"
No, I believe Coninoxx is correct. (Unfortunately he wasn’t, see below)
It changes, so it starts, (at whatever value) it waits for 20 seconds, if it changes again the wait is cancelled and the new state value fires it again, wait 20 seconds…
It deviously complies with what I know of the rules,
Me Likey
Okay, well that would have been the nice and quick way of doing it
What you’ll have to do is create a binary sensor that returns true when now() - .last_changed (of your other sensor) is greater than 20 secs
Not at my workstation at the mo so you’ll have to do some research
Edit: Microsoft decided to upgrade my laptop this morning, this is after my main workstation had a motherboard failure 2 days before. Once it’s back up I’m really going to concentrate on an Ubuntu workstation.
As a result I have had a couple of edits of the above and I’m still unable to test it.
What section are you putting this.?
It needs to go under binary_sensor:
If you put the template I gave you into the template editor … Wait no !
Put this in instead : -
This will give you the number of seconds since the last change.
So get a value, move the blind (or change it to another entity if that’s easier) and then update the editor (add a space then backspace over it) you should see the number change.
Then add the > 20 back in and it will go from false to true 20 secs after the change.
You then trigger your automation on the state change of this binary sensor going to true.
Edit: can anyone else test just to see if I’ve missed a bracket or something ?
jones, I use packages but your definition of a binary sensor should look something like this : -
binary_sensor:
- platform: template
sensors:
bs_occupied_mutt:
entity_id: device_tracker.life360_muttley, input_boolean.ib_occupied_mutt_away
value_template: "{{ is_state('device_tracker.life360_muttley', 'home') and is_state('input_boolean.ib_occupied_mutt_away', 'off') }}"
friendly_name: Mutt At Home
I picked one that was a single line template (needs quotes) rather than a multiline template (that doesn’t)
I then picked two entities that exist on my system that I could easily change, I’ll leave alone and the other I’ll change, image, wait and image again. I’ll set the offset to 2 mins as I have to take screen images and save them. Note how the result flips around on the 120 second period.