Hey all,
Well I had this idea to sniff out the feedback from an press of the hue tab from the hue_event state. If i go to Events and listen to the feedback from pressing on a hue tap botton I get something like:
{
"event_type": "hue_event",
"data": {
"id": "hue_tap_switch_gastenkamer",
"device_id": "a246e2240465db1ffcfc983eb157b0d6",
"unique_id": "00:00:00:00:00:46:bb:d1-f2",
"event": 34,
"last_updated": "2021-11-11T09:02:10"
},
"origin": "LOCAL",
"time_fired": "2021-11-11T09:02:10.282833+00:00",
"context": {
"id": "d12eec9dcd702e3bd3ff6234f126d634",
"parent_id": null,
"user_id": null
}
}
So my thoughts were; well if I can get a event state back: like 34. I should be able to set up a scene for all of these states and make a nice automation of of this. The reason for this work around is that an other option like Interloping made is great; but seems a quite a big work. Next to that; my experience isn’t that big. So i though let’s try it an easy way. Well it seems I was wrong. As this doesn’t seem to work.
My current try of the automation is like:
- id: Hue tap
alias: Hue tap control
trigger:
- event: hue_event
device_id: a246e2240465db1ffcfc983eb157b0d6
entity_id: hue_tap_switch_gastenkamer
platform: state
action:
- delay:
milliseconds: 20
- data_template:
entity_id:
- scene.
{%- if is_state('event.hue_tap_switch_gastenkamer', '34') -%}
slaapkamer_licht_100
{%- elif is_state('event.hue_tap_switch_gastenkamer', '16') -%}
gastenkamer_licht_50
{%- elif is_state('event.hue_tap_switch_gastenkamer', '17') -%}
slaapkamer_licht_25
{%- elif is_state('event.hue_tap_switch_gastenkamer', '18') -%}
gastenkamer_licht_uit
{%- else -%}
gastenkamer_licht_uit
{% endif %}
service: scene.turn_on
So as I understand: I can’t read a hue_event, as is seems not to exist (but neither does hue). So what is the way to go there? Can you guys help me on the way; so I can proceed with my route to a nice simple automation?