Report date and time of NODE-RED flow in Home Assistant

You can create a sensor to read the data.

image

sensor:

  - platform: template
    sensors:
      test:
        value_template: "{{ states('input_text.beregening_text') }}"
1 Like

Hi Sender, I hereby send you the flow which is working now.

[{"id":"6aa7f865.adda18","type":"api-call-service","z":"d571caff.44b17","name":"Date & Time","server":"ab0c7805.ea8858","version":1,"debugenabled":false,"service_domain":"input_text","service":"set_value","entityId":"input_text.beregening_text","data":"{\"value\":\"{{time}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":490,"y":300,"wires":[[]]},{"id":"ab0c7805.ea8858","type":"server","z":"","name":"Home Assistant","addon":true}]

Good luck!

Thanks Hellis81 for your help! It is working now! One small question left: what is the purpose of the leading zero in the date and time in the function above?

Great!

Well… Now there is not much need for it.
In the past when you add it to a datetime I believe it’s needed because the datetime format is rather strict.
But now that you have it in a text then it makes no difference.
Change it to how you want, the input_text will accept it.

Thank you.

One more question. This is the node red part… is there anything specific needed in hass? Entity creation or the node-red integration?

Please see my post from yesterday. That post contains also the code which need to be added in configuration.yaml. No other changes are required.