You are amazing. I am so excited to learn more Node Red as I have almost all my automations transferred over from HE.
I made a minor tweak to your formula as the volume of the overhead speaker needed to be louder.
[{"id":"e1178c19.fd803","type":"delay","z":"d4f9ac9d.d5ff08","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"2","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":320,"y":620,"wires":[["21bc6a08.9dfc86"]]},{"id":"f4814901.6f0b88","type":"server-state-changed","z":"d4f9ac9d.d5ff08","name":"Kitchen TV Vol","server":"4bbca37b.1700ec","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"media_player.kitchen_tv_speaker","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":120,"y":620,"wires":[["e1178c19.fd803"]]},{"id":"21bc6a08.9dfc86","type":"function","z":"d4f9ac9d.d5ff08","name":"","func":"msg1 = {};\nmsg2 = {};\n\nmsg1.volume = msg.data.new_state.attributes.volume_level;\nmsg2.volume = msg.data.new_state.attributes.volume_level +0.2;\n\nreturn [msg1, msg2];","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":490,"y":620,"wires":[["bd26bd03.ba53d","b0aaa5f6.b7ec98"],["93e3563e.bb1878","c2f66dd2.82b45"]]},{"id":"bd26bd03.ba53d","type":"debug","z":"d4f9ac9d.d5ff08","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":670,"y":580,"wires":[]},{"id":"93e3563e.bb1878","type":"debug","z":"d4f9ac9d.d5ff08","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":670,"y":640,"wires":[]},{"id":"c2f66dd2.82b45","type":"api-call-service","z":"d4f9ac9d.d5ff08","name":"Overhead Vol.","server":"4bbca37b.1700ec","version":3,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"media_player.kitchen_overhead ","data":"{ \"volume_level\" : {{ volume}} }","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":680,"y":740,"wires":[[]]},{"id":"b0aaa5f6.b7ec98","type":"api-call-service","z":"d4f9ac9d.d5ff08","name":"TV Vol.","server":"4bbca37b.1700ec","version":3,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"media_player.kitchen_tv_speaker","data":"{ \"volume_level\" : {{ volume}} }","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":650,"y":520,"wires":[[]]},{"id":"4bbca37b.1700ec","type":"server","name":"Home Assistant","version":1,"legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
Two more questions:
-
Is there a way through the same function to make it so that if media_player.kitchen_tv_speaker < 10 then media_player.kitchen_overhead = 0
-
On this message board… how can I make my Nodes appear as a single line of copied text.