How can I trigger a Broadlink IR toggle based on a power reading?
I have an Amino set top box connected to a Z-wave powerplug that measures the power usage. For the Amino, only a power toggle IR code is available (so no discrete ON and OFF).
What I’m looking to accomplish:
- Switch on the activity ‘watching television’ in HA → turn on the power plug.
- If Amino power usage < 5.1: send a power toggle through Broadlink IR.
- If Amino power usage > 5.1: do nothing, the Amino is already on.
What is the best way to accomplish this? I think it should be a template of some kind, but what should it look like?
Maybe a template switch like this:
- platform: template switches: amino: value_template: "{{ sensor.powerplug_woonkamer_power | float > 5.1, 'on' }}" turn_on: service: switch.broadlink_send_packet_192_168_1_22 data: # Power toggle Amino packet: 'JgA4AD8zfg8UDwABdhATAAoRPzNsDyYPAAFkDyYAChE/Mm0PJg8AAWQPJgAKED8zbBAlEAABZA8lAA0F' turn_off: service: switch.broadlink_send_packet_192_168_1_22 data: # Power toggle Amino packet: 'JgA4AD8zfg8UDwABdhATAAoRPzNsDyYPAAFkDyYAChE/Mm0PJg8AAWQPJgAKED8zbBAlEAABZA8lAA0F'
Then … ? Am I on the right track?