Value Template from HA Website

Did you follow the instructions to actually test the trigger using the States tool?

Yes… I’ve done it two ways. Changed the float to below 58 and manipulted it in sates. The value template is reading properly but it does not trigger the relay (which is correctly addressed etc and fires under normal timer control)

What does the Trace show?

Nothing… because its never actually triggered anything

That’s pointless, you should use a numeric state trigger for that, plus you have a stray space after states

  - platform: numeric_state
    entity_id: sensor.hot_water_control_air_temperature
    below: 58

Thanks @Tinkerer but the issue with numeric state is that i need a boost, so if we have an event on and the hot water drops below say 30, we need to boost it. If a numeric trigger it would have to cross the threshold? We could just fire the hot water relay but that would only work once (as I have a numeric automation which turns hot water relay off at 60 - or else it would overheat). The idea of the boost is that we can toggle it on the overview with a predetermined duration (2 hours for example). To put this into context, evens are ad hoc so we would manually call the automation. Possibly link it to a motion sensor in the guest area

I’m open to suggestions if there is another way?

Thanks

And the same is true of the template trigger you’re using.

Add another trigger to “boost” it, a button or boolean for example.

Thanks again @Tinkerer

I have now figured out how useful helpers are. I set up a threshold with lower and upper limits of the hot water then a boolean to trigger it as you suggested. Much easier than messing around with value templates.

Everydays a school day

1 Like

Hi Guys

I thought I had this nailed… however its giving me a headache again. I did the following -

  1. Set up a helper - toggle ‘hot water boost’ - input_boolean.hot_water_boost_toggle
  2. Set up a helper - threshold read from hot water sensor. Lower set at 10. Upper set at 50 - binary_sensor.hot_water_boost
  3. Set up the following automation -
alias: Hot Water Boost
description: ""
trigger:
  - platform: state
    entity_id:
      - input_boolean.hot_water_boost_toggle
condition:
  - condition: state
    entity_id: input_boolean.hot_water_boost_toggle
    state: "on"
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: binary_sensor.hot_water_boost
            state: "on"
        sequence:
          - service: switch.turn_on
            data: {}
            target:
              device_id: 885ff857910a22568ba3adb75828ffa1
      - conditions:
          - condition: state
            entity_id: binary_sensor.hot_water_boost
            state: "off"
        sequence:
          - service: switch.turn_off
            data: {}
            target:
              device_id: 885ff857910a22568ba3adb75828ffa1
          - service: switch.turn_off
            data: {}
            target:
              device_id: ceb20e35b91d7ea09b6ceebdb438dd3c
mode: restart

It seems to be turning off the device 885ff857910a22568ba3adb75828ffa1 every minute or two for some reason, even though the state is ‘on’ when I’ve checked

Any ideas?

Why?

trigger:
  - platform: state
    entity_id:
      - input_boolean.hot_water_boost_toggle
    to: "on"

would be better

What does the trace show?

It doesnt mention the hot water switch turning off anywhere…

This is the changed variables -

this:
  entity_id: automation.hot_water_boost_2
  state: 'on'
  attributes:
    id: '1692041457728'
    last_triggered: '2023-08-19T19:40:04.420252+00:00'
    mode: restart
    current: 0
    friendly_name: Hot Water Boost
  last_changed: '2023-08-19T19:46:21.986231+00:00'
  last_updated: '2023-08-19T19:46:21.986231+00:00'
  context:
    id: 01H87NB5N2B839EYF97N5A5YEC
    parent_id: null
    user_id: null
trigger:
  id: '0'
  idx: '0'
  alias: null
  platform: state
  entity_id: input_boolean.hot_water_boost_toggle
  from_state:
    entity_id: input_boolean.hot_water_boost_toggle
    state: 'off'
    attributes:
      editable: true
      icon: mdi:thermometer-water
      friendly_name: Hot Water Boost - Toggle
    last_changed: '2023-08-19T19:40:06.499969+00:00'
    last_updated: '2023-08-19T19:40:06.499969+00:00'
    context:
      id: 01H87MZPZ3D23GJ2AKVC3D1Q6E
      parent_id: null
      user_id: be3c052223214f7e86eae4c5812ed2ba
  to_state:
    entity_id: input_boolean.hot_water_boost_toggle
    state: 'on'
    attributes:
      editable: true
      icon: mdi:thermometer-water
      friendly_name: Hot Water Boost - Toggle
    last_changed: '2023-08-19T20:12:01.774572+00:00'
    last_updated: '2023-08-19T20:12:01.774572+00:00'
    context:
      id: 01H87PT5BD59G6FY1VH8K6B0VX
      parent_id: null
      user_id: be3c052223214f7e86eae4c5812ed2ba
  for: null
  attribute: null
  description: state of input_boolean.hot_water_boost_toggle

It was turning the switch off for a strange reason… I have a z-wave combined switch / sensor. I have to automate a ‘refresh’ for the temp sensor. If I refresh every 2 minutes then it turns the switch off. If I refresh every 5 minutes it seems to be OK.

The boost is kind of working now, except it isnt turning off when the binary sensor state changes to ‘off’.

I followed your advice and set the automation to the following -

trigger:
  - platform: state
    entity_id:
      - input_boolean.hot_water_boost_toggle
    to: "on"

I’m wondering if this will cause the automation not to work properly as it needs the toggle to be triggered to continue with the automation?

Thanks

What you wrote triggered any time the boolean changed state (or an attribute changed) and then checked that it was on before continuing.

What I wrote would only trigger when the boolean was turned on, from off.

I think I’ve sorted it… the trigger should be the state of the threshold (ON) with the condition that the input boolean toggle is ‘on’ and automation set to ‘restart’

Hi Guys, me again!

I’ve got an issue with the value template of thermostats now… code below -

{{ state_attr('climate.honeymoon_suite_bathroom','current_temperature') - state_attr('climate.honeymoon_suite_bathroom','temperature') | int < 1 }}

This works great, however when the ‘current temperature’ changes state to be equal to the ‘temperature’ it reads ‘true’.

My understanding is - it should not read true until the temp exceeds 1. Not sure why its reading true when ‘equal to’?

Can I have another line to this with ‘!=’ (not equal to) which will then force a ‘false’ when equal in the same script?

I cant figure out how to format it (if its possible)

Thanks
Byron