a volume step of 50 means it will do 2 steps or jumps as you call them per event(turn)…
so choose a number between 1 - 100 (the larger the number the smaller the steps)
Sorry for the delay in replying. This is indeed a very strange case. Since I do not have the same setup as you, the only thing I could do is to add this configuration to the integration tests I have setup. I did not find any problems when double-clicking with and without merge_mapping. I see that multiple_click_delay is 1000 with mapping and 500 with merge_mapping. I would recommend you leaving to 1000 to experiment if it working properly. Once it is working, you can make this value lower.
Could you also show the logs when clicking and double-clicking, so I see better this behaviour with the logs.
Glad you got it working with a work around. Thank you for the update. However, the “on” and “off” were not working because the YAML parser parses on and off as boolean variables (true and false). So you need to wrap “on” and “off” with quotes (").
As @hans80 pointed out, you can use volume_steps to define how many steps (or jumps) are needed to go up or down. The higher, the smaller steps will take, a step of 1 means to go from min to max in 1 go.
However, this does not assure you to calibrate it in a way to make 100% with 2 full rotations. This controller fires a rotation start action when start rotating and a rotation release when the rotation is stopped. While waiting for those 2 events, ControllerX sends periodic requests to HA to change the volume. So if you do a quick 2 full rotations in 1s, it will be the same as moving slowly half rotation in 1s.
Also, I would recommend you to take a look at point #9 in the FAQ. Your controller will work smoother if connected to MQTT directly, rather than using the HA sensor.
In this case when the 2002 deCONZ event is fired, it will not be executed until 10 seconds after. What 2002 event does depends on the controller or whatever you define in the mapping section.
Let me know if it needs more clarifying, or if you were asking for something else.
My son sometimes goes to the toilet during the night. So he turns on the light in the room, goes to the toilet, comes back and jumps into bed. But he doesnt want to fall a sleep without the lights on so he leaves them on.
So it would be nice when he turns on the light it turns off automatically after 30 minutes…
I had a look an the short press ( left and right ) give me the following
2021-01-04 20:02:25.563274 INFO sonos_controller: 🎮 Button event triggered: `4002`
2021-01-04 20:02:25.568672 INFO sonos_controller: 🏃 Running `previous_track` now
2021-01-04 20:02:25.573746 INFO sonos_controller: 🤖 Service: media_player.media_previous_track
2021-01-04 20:02:25.578451 INFO sonos_controller: - entity_id: media_player.sonos
2021-01-04 20:02:34.158518 INFO sonos_controller: 🎮 Button event triggered: `5002`
2021-01-04 20:02:34.163536 INFO sonos_controller: 🏃 Running `next_track` now
2021-01-04 20:02:34.168264 INFO sonos_controller: 🤖 Service: media_player.media_next_track
2021-01-04 20:02:34.173200 INFO sonos_controller: - entity_id: media_player.sonos
but on a long press I get nothing.
as for the github post, no that wasn’t me, but I probably should have posted there… Sorry…
Thank you for looking into it though
Robin
edit: on a totally different note though… when I press the power button it plays the last thing that came through the speaker (more often than not my doorbell) is it possible to have it play a certain station first?
edit: on a totally different note though… when I press the power button it plays the last thing that came through the speaker (more often than not my doorbell) is it possible to have it play a certain station first?
No, this is not supported. However, you could create an HA script for it and call it from ControllerX configuration. You will need to use different configurations with callback constraints from AppDaemon to call play_pause when the media player is paused, and call the script with the right station when idle. Happy to help further if needed
As mentioned before, you could use action_delay, but this will work just if your son clicks the controller again to turn it off. Not very convenient. For this I would recommend you to set up an HA configuration like the following:
alias: 'Turn kid bathroom light off automatically at night'
mode: restart
trigger:
- platform: state
entity_id: light.kid_bathroom
to: 'on'
condition:
- condition: time
after: '21:00:00'
before: '07:00:00'
action:
- delay: '1800' # 30 minutes in seconds
- service: light.turn_off
entity_id: light.kid_bathroom
So, when the light turns on, this automation is triggered. Then it first checks that is night time (between 21 and 7), then it waits 30 minutes (1800 seconds), and finally it turns the light off.
You can copy this YAML into the HA YAML editor for automations and change the light for your entity light name.
Great project.
What’s det procedure for when i have two or more of the same controller?
Their id is the same and it doesn’t matter if i rename them in deconz/ha. Their unique id also seems to be the same.
You are saying that you have 2 controllers that are the same, and they have the same name and unique ID?
About the same name, I am not sure, but their unique ID should be different. Be that as it may, you can change the name of your controller through the Phoscon app. Go to Switches, click on the switch that has the same name, and then click in the pencil to edit the name. That is the name that is used in the controller attribute when configuring a deCONZ device.
No, it only allows to use the “id”, not the “unique_id”. Once you change the name through Phoscon, I recommend you to restart the deCONZ addon, and even Home Assistant. That should fix your problem.
Sorry for this. Someone made me realized that the default mapping for de deCONZ integration was missing the 4001 and 5001 events. I added them and it will be fixed for next relase, so you will be able to remove the merge_mapping part again.
Notice that you are overwriting the click with next source. The default mapping for the click (4002 and 5002) is next/previous track. If that is what you want is fine, otherwise, you can change it to 4001 and 5001.