Hey guys,
how can i check with node-red if a state is equal to a list of values?
This one is not working
Hey guys,
how can i check with node-red if a state is equal to a list of values?
This one is not working
You could get the current state of the media player and send that to a switch node.
[{"id":"db85d97438119aeb","type":"tab","label":"Flow 4","disabled":false,"info":"","env":[]},{"id":"cb2b2d5076e63180","type":"debug","z":"db85d97438119aeb","name":"","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1100,"y":600,"wires":[]},{"id":"85a066ef0d14c220","type":"inject","z":"db85d97438119aeb","name":"Every Day at 2:00 AM","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 02 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":120,"wires":[["2a63156992066e82"]]},{"id":"2a63156992066e82","type":"api-current-state","z":"db85d97438119aeb","name":"TV ON?","server":"8be923df.d66f9","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"media_player.lg_webos_tv_living_room","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":320,"y":120,"wires":[["9e91b4b1867d5913"]]},{"id":"9e91b4b1867d5913","type":"switch","z":"db85d97438119aeb","name":"Switch based on State","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"avail","vt":"str"},{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"idle","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":4,"x":520,"y":120,"wires":[[],[],[],[]]},{"id":"8be923df.d66f9","type":"server","name":"homeassistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"","connectionDelay":false,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
You are the man. Thank you!