Message automation

I have an automation in home assistant that send a message when its below 0 C outside at a time that is set in a input time helper.
How can i make this in node red
i use a average temp sensor that has a attribute with min temp

- id: '1600426864406'
  alias: Message below 0 c
  description: ''
  - platform: time
    at: input_datetime.below_0
  - condition: numeric_state
    entity_id: sensor.average_temp_8_h
    attribute: min_value
    below: '0'
  - service: notify.mobile_app_sm_n970f
      message: Below 0 c
  mode: single 

I don’t know if inject node can have a flow message as time but I would try that.
I’m currently typing on my phone so I can’t try it out myself.

But trigger on datetime change -> set flow.time = datetime

Then see if you can have the inject node with {{ flow.time }}

Or you should be able to trigger on sensor.time if you have added that to your configuration.yaml

Ok thanks for helping. The trigger part i can use just the inject node.
But how do i do with the condition that it has been below zero during the last 8h

There is the get history node.
But it might be easier to use a statistics sensor, if I recall correctly it will give you min, max, median and so on.
Perhaps that is enough?

Here’s some examples of how to trigger a flow based on a timestamp from HA.

and how to check if a condition happened in the last X hours.

To check the attributes of a sensor use a current-state node into a switch statement.



Thanks Kermit fot the help that worked