How do i add a threshold helper to an automation

I’m trying to add 3 triggers for Blood readings and ned 3 Threshold helpers to turn Lights from Blue to red if low Range

and if high Range turn Lights red

And Turn lights blue if Normal Range.

I have made the 3 helpers but not sure how I had them into a Automation to do this process.

Any help be great on it.

I have managed to do it another way but the lights go red but do not come back to Blue when the range gets back into a Normal Range so someone mentioned to make a helper for it.

Its how I add the trigger for it I do not know.

This is what I have so for:

Low Range:

Normal Range:

High Range:

How do I add the helper?

So red light if high or low and blue if normal.

You only need one. This one:

339424ab25c8a94210e5f2f425074e16a11f45af_2_397x500

This will create a binary sensor called binary_sensor.normal_blood_reading.

I would rename the threshold sensor to “Abnormal Blood Reading” though, as it will be on when outside the normal range.

You can use it like this:

Automation 1, abnormal range → red light

triggers:
  - trigger: state
    entity_id: binary_sensor.abnormal_blood_reading
    from: 'off'
    to: 'on'
actions:
  action: <turn your light red here>

Automation 2, normal range → blue light

triggers:
  - trigger: state
    entity_id: binary_sensor.normal_blood_reading
    from: 'on'
    to: 'off'
actions:
  action: <turn your light blue here>

yes I was thinking I do not want the light on in normal range I just want the colour to go back to blue until sunset when the lights come on auto to motion.

Its a very hard one to do this as so complex and confusing.
Thanks
Will try tomorrow!

so you are saying to name my normal range helper to Abnormal Blood Reading?

what do I call the high Range and low range ones?

I cannot just have a Normal range as the light only needs to go red when below 73.5 and again only go red light when over 162 if it’s in between the Blue light and this needs to be 24/7 but the light does not have to be on 24/7 only after sunset with motion or if low but when back to normal light still needs to come on with motion after sunset

Hope I explained all this right its a mouth full :rofl: :rofl:

Automation 1, abnormal range → red light

triggers:
  - trigger: state
    entity_id: binary_sensor.abnormal_blood_reading
    from: 'off'
    to: 'on'
conditions:
  - condition: state  # 'day' condition: from sunrise until sunset
    entity_id: sun.sun
    state: "above_horizon"
actions:
  action: <turn your light red here>

Automation 2, normal range → blue light

triggers:
  - trigger: state
    entity_id: binary_sensor.normal_blood_reading
    from: 'on'
    to: 'off'
conditions:
  - condition: state  # 'day' condition: from sunrise until sunset
    entity_id: sun.sun
    state: "above_horizon"
actions:
  action: <turn your light blue here>

This is how I have it at moment and is no good!

alias: Turn Lights on if low - colour
description: Turns light on if low with colour change to red
trigger:
  - platform: numeric_state
    entity_id:
      - sensor.blood_sugar
    id: Low-readings
    above: 0
    below: 70
  - platform: numeric_state
    entity_id:
      - sensor.blood_sugar
    id: normal-readings
    above: 75
  - platform: numeric_state
    entity_id:
      - sensor.blood_sugar
    for:
      hours: 0
      minutes: 2
      seconds: 0
    id: Normal-readings-turn off light
    above: 76
  - platform: state
    entity_id:
      - binary_sensor.low_blood_reading
    id: Low-readings_helper
condition: []
action:
  - choose:
      - conditions:
          - condition: time
            after: "22:00:00"
            before: "21:00:00"
            weekday:
              - sun
              - mon
              - tue
              - wed
              - thu
              - fri
              - sat
        sequence: []
      - conditions:
          - condition: trigger
            id:
              - Low-readings
        sequence:
          - action: light.turn_on
            target:
              entity_id: light.bedroom_led
            data: {}
          - action: light.turn_on
            target:
              entity_id: light.bed_side_lamp
            data:
              rgb_color:
                - 255
                - 0
                - 0
      - conditions:
          - condition: trigger
            id:
              - normal-readings
        sequence:
          - action: light.toggle
            target:
              entity_id:
                - light.bed_side_lamp
                - light.bedroom_led
            data:
              rgb_color:
                - 5
                - 159
                - 255
          - action: light.turn_off
            target:
              entity_id:
                - light.bedroom_led
                - light.bed_side_lamp
            data: {}
mode: single

I need to study it tomorrow tired now thanks!