Hey all,
How can I use the current state node to drill down on a media player and check the source? I was thinking something like like this
But it just says playing regardless of the source
Thanks
Hey all,
How can I use the current state node to drill down on a media player and check the source? I was thinking something like like this
But it just says playing regardless of the source
Thanks
Hope this helps someone; its
$entity().attributes.source = โiPhoneโ
i use this:
[{"id":"a172843b743d9edf","type":"function","z":"5a62a7e4.2faa58","name":"check source","func":"var source = msg.data.new_state.attributes.source;\nvar sourcelist = [\"Plex\",\"Netflix\",\"YouTube\",\"KPN iTV\",\"NPO\"];\nmsg.payload =msg.data.new_state.attributes.source\nif (sourcelist.includes(source)){ \n return [null,msg];\n}\nreturn [msg,null];\n","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":590,"y":160,"wires":[["154b86225393e378","c48c42a6.78523"],["6edda95325579a4a"]]}]