Read value from helper of type number in Node-red

Hello everybody.

I would like to know read values from a helper of type number from NodeRed.
Basically I want to use the slider in lovelace and when changed I want it to affect the related NodeRed automation in which I am using it.

I started yesterday with node-red so it would be great if you could suggest some examples.

Thanks a lot!

Either you use a trigger state node. This will fire each time you change the slider.
Or a current state node, this will only check the number in the sequence and need a different “trigger”.

[{"id":"3877cd37.bf6712","type":"trigger-state","z":"caebef34.4abf3","name":"","server":"4bbca37b.1700ec","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"input_number.google_say_volume","entityidfiltertype":"exact","debugenabled":false,"constraints":[],"constraintsmustmatch":"all","outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","x":420,"y":520,"wires":[["69514772.9a8108"],[]]},{"id":"69514772.9a8108","type":"debug","z":"caebef34.4abf3","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":720,"y":560,"wires":[]},{"id":"257306f9.d18dba","type":"inject","z":"caebef34.4abf3","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":640,"wires":[["df9ed939.632068"]]},{"id":"df9ed939.632068","type":"api-current-state","z":"caebef34.4abf3","name":"","server":"4bbca37b.1700ec","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_number.google_say_volume","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":420,"y":640,"wires":[["69514772.9a8108"]]},{"id":"4bbca37b.1700ec","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

With the event state node a message will be sent every time you move the slider. The state of the slider, which is the numeric value in this case, is contained in the msg.payload. You can use that information in your service.

What service are you trying to call?

Thanks a lot @Hellis81and @obaldius.
I was able to what I wanted in the end.
I am still only scratching the surface with nodered but I really think is a great automation framework.
Have to admit the guides from this guy were extremely useful.
I am attaching a screeenshot of the automation.
Basically it allows me to toggle a device based on threshold (e.g. temperature) set using an input slider from lovelace.
additionally it can do:

  • periodically check the threshold and act accordingly
  • check without delays when the slider is moved
  • only do the above the automation toggle help is on

1 Like