0

Need a bit of advice here, I am trying to code up LEDs which change colour the higher my heart rate goes on Zwift. Hardware I am using is: D1 Mini WS2812B LEDs Connected with jumpers (5v, G, D4 data) Used ESPhome to flash the D1 Mini. In automations, below I will place the code, So far I have only input the thresholds of the different heart rate, will get to the colour change once I get it to trigger. When I execute the automation through the UI in Home Assistant it works, but when I am on Zwift it does not work. It should be taking the heart rate data from the sensor and then turn the LED on if heart rate above 70 (as said just trying to get it to turn on then once this is done get it to change colour at different threasholds) The data is going into home assistant as I have built a Grafana Dashboard which shows the heart rate data live from the sensor (refreshing every 5seconds) , and it works in the dashboard, so I know the data is going into homeassistant correctly.

I have set up the LED as an entity also What am I missing here? Any help greatly appreciated. Here is the Automation code:

- id: '1605030778837'
alias: hEART_1_Automation
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.zwift_heart_rate_2672785
above: '60'
below: '220'
attribute: friendly_name
condition: []
action:
- service: light.turn_on
 data: {}
entity_id: light.heartrate_led_2_4
mode: single
Ronan
  • 1
  • 1

1 Answers1

0

I think you can remove attribute: friendly_name from the trigger, as that doesn't hold the heart rate value (the state).

By the way. if you trigger an automation from the automations screen it bypasses all conditions, this is something to keep in mind.

Sander
  • 1
  • 4