Message automation

Hello
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: ''
  trigger:
  - platform: time
    at: input_datetime.below_0
  condition:
  - condition: numeric_state
    entity_id: sensor.average_temp_8_h
    attribute: min_value
    below: '0'
  action:
  - service: notify.mobile_app_sm_n970f
    data:
      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.

https://zachowj.github.io/node-red-contrib-home-assistant-websocket/cookbook/using-date-and-time-entities-to-trigger-flows.html

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

https://zachowj.github.io/node-red-contrib-home-assistant-websocket/cookbook/check-if-an-entity-was-turned-on-in-the-last-24-hours.html

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

image

[{"id":"c4c3d35c.faee8","type":"api-current-state","z":"ffbd7f06.4a014","name":"","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.average_temp_8_h","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":270,"y":1200,"wires":[["af2b34c7.147088"]]},{"id":"af2b34c7.147088","type":"switch","z":"ffbd7f06.4a014","name":"","property":"data.attributes.min_value","propertyType":"msg","rules":[{"t":"lt","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":514,"y":1200,"wires":[[]]}]

Thanks Kermit fot the help that worked