forked from homeean/node-red-contrib-homee-flows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Alexa mit Lautstärkereglung und Senderwahl sowie MQTT Anbindung.json
1 lines (1 loc) · 9.51 KB
/
Alexa mit Lautstärkereglung und Senderwahl sowie MQTT Anbindung.json
1
[{"id":"f60cd034.ec6d5","type":"homeeDevice","z":"4c6baea6.cd3f4","homee-sim":"37775b15.22ebc4","name":"Echo Mobile","nodeId":"16","profile":"1001","icon":"nodeicon_speaker","attributes":"[{\"id\":160,\"node_id\":16,\"instance\":0,\"minimum\":0,\"maximum\":1,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"\",\"step_value\":1,\"editable\":1,\"type\":1,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":161,\"node_id\":16,\"instance\":0,\"minimum\":0,\"maximum\":100,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"%25\",\"step_value\":1,\"editable\":1,\"type\":2,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":162,\"node_id\":16,\"instance\":2,\"minimum\":0,\"maximum\":10,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"Sender\",\"step_value\":1,\"editable\":1,\"type\":2,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"}]","x":470,"y":720,"wires":[["1369d1e8.e1d65e"]]},{"id":"7fac10a5.d4801","type":"mqtt out","z":"4c6baea6.cd3f4","name":"On/Off","topic":"alexa/mobile","qos":"","retain":"","broker":"db0ac03f.e4ae2","x":930,"y":680,"wires":[]},{"id":"ecc8faca.e43428","type":"mqtt out","z":"4c6baea6.cd3f4","name":"Volume","topic":"alexa/mobile_volume","qos":"","retain":"","broker":"db0ac03f.e4ae2","x":940,"y":720,"wires":[]},{"id":"527aad82.e9a214","type":"function","z":"4c6baea6.cd3f4","name":"Volume","func":"if (msg.payload.targetValue > 0){node.send({payload:msg.payload.targetValue})}","outputs":1,"noerr":0,"x":800,"y":720,"wires":[["ecc8faca.e43428"]]},{"id":"b2e9ac19.045e8","type":"function","z":"4c6baea6.cd3f4","name":"On/Off","func":"{node.send({payload:msg.payload.targetValue})}","outputs":1,"noerr":0,"x":790,"y":680,"wires":[["7fac10a5.d4801"]]},{"id":"1369d1e8.e1d65e","type":"switch","z":"4c6baea6.cd3f4","name":"","property":"payload.attributeId","propertyType":"msg","rules":[{"t":"eq","v":"160","vt":"num"},{"t":"eq","v":"161","vt":"num"},{"t":"eq","v":"162","vt":"num"}],"checkall":"true","repair":false,"outputs":3,"x":630,"y":720,"wires":[["b2e9ac19.045e8"],["527aad82.e9a214"],["513adde2.24a6d4"]]},{"id":"513adde2.24a6d4","type":"function","z":"4c6baea6.cd3f4","name":"Station","func":"var value = msg.payload.targetValue;\nvar stationid = 96270; //Hitradio RTL\nfunction sender(){\n switch (value){\n \n case 0: stationid= 96270;break; //Hitradio RTL\n case 1: stationid= 25774;break; //Antenne Thüringen\n case 2: stationid= 25770;break; //Hitradio Antenne 1\n case 3: stationid= 17496;break; //Radio PSR\n case 4: stationid= 84546;break; //Landeswelle Thüringen\n case 5: stationid= 45087;break; //Eins Live diggi\n case 10: stationid= 24939;break; //Radio BBC 1\n }\n}\nif (msg.payload.attributeId === 162 ){sender()\nreturn {payload: `s`+stationid};}","outputs":1,"noerr":0,"x":800,"y":760,"wires":[["bbaa894.c750a78"]]},{"id":"bbaa894.c750a78","type":"mqtt out","z":"4c6baea6.cd3f4","name":"Radio Station","topic":"alexa/mobile_radio_station","qos":"","retain":"","broker":"db0ac03f.e4ae2","x":960,"y":760,"wires":[]},{"id":"7e3c3449.fa9cbc","type":"mqtt in","z":"4c6baea6.cd3f4","name":"State","topic":"alexa/mobile_state","qos":"2","datatype":"auto","broker":"db0ac03f.e4ae2","x":70,"y":680,"wires":[["f262b530.969698"]]},{"id":"141ac8c4.24c2b7","type":"mqtt in","z":"4c6baea6.cd3f4","name":"Volume","topic":"alexa/mobile_volume","qos":"2","datatype":"auto","broker":"db0ac03f.e4ae2","x":70,"y":720,"wires":[["9debb6f7.898448"]]},{"id":"f262b530.969698","type":"function","z":"4c6baea6.cd3f4","name":"","func":"if (msg.payload === \"true\"){var status = 1}\n else var status = 0;\n node.send({payload:{\"id\":160,\"value\":status}})","outputs":1,"noerr":0,"x":250,"y":680,"wires":[["f60cd034.ec6d5"]]},{"id":"9debb6f7.898448","type":"function","z":"4c6baea6.cd3f4","name":"","func":"node.send({payload:{\"id\":161,\"value\":parseFloat(msg.payload)}})","outputs":1,"noerr":0,"x":250,"y":720,"wires":[["f60cd034.ec6d5"]]},{"id":"cf630f42.0513b","type":"mqtt in","z":"4c6baea6.cd3f4","name":"Station Id","topic":"alexa/mobile_radiostation_id","qos":"2","datatype":"auto","broker":"db0ac03f.e4ae2","x":80,"y":760,"wires":[["305b4e2.5f8fab2","84ccb8ef.93baf8"]]},{"id":"305b4e2.5f8fab2","type":"function","z":"4c6baea6.cd3f4","name":"","func":"if (msg.payload === \"s96270\"){var stationid = 0}\nif (msg.payload === \"s25774\"){var stationid = 1}\nif (msg.payload === \"s25770\"){var stationid = 2}\nif (msg.payload === \"s17496\"){var stationid = 3}\nif (msg.payload === \"s84546\"){var stationid = 4}\nif (msg.payload === \"s45087\"){var stationid = 5}\nif (msg.payload === \"s24939\"){var stationid = 5}\n\n\n\n\nnode.send({payload:{\"id\":162,\"value\":stationid}})","outputs":1,"noerr":0,"x":250,"y":760,"wires":[["f60cd034.ec6d5"]]},{"id":"84ccb8ef.93baf8","type":"debug","z":"4c6baea6.cd3f4","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":270,"y":800,"wires":[]},{"id":"30a055b1.1ec46a","type":"comment","z":"4c6baea6.cd3f4","name":"Alexa Flow mit Senderwahl und Lautstärkereglung","info":"","x":210,"y":620,"wires":[]},{"id":"6315099e.118878","type":"ioBroker in","z":"4c6baea6.cd3f4","name":"volume","topic":"alexa2.0.Echo-Devices.GJJ7887VGHH87ZZ.Player.volume","payloadType":"value","onlyack":"","func":"all","gap":"","x":120,"y":920,"wires":[["3de4e5aa.4eac0a"]]},{"id":"3de4e5aa.4eac0a","type":"mqtt out","z":"4c6baea6.cd3f4","name":"","topic":"alexa/mobile_volume","qos":"","retain":"","broker":"8a37d0c6.f5ee5","x":340,"y":920,"wires":[]},{"id":"967c4991.849958","type":"mqtt in","z":"4c6baea6.cd3f4","name":"","topic":"alexa/mobile_volume","qos":"2","datatype":"auto","broker":"8a37d0c6.f5ee5","x":120,"y":980,"wires":[["904ab27d.49c74"]]},{"id":"a0748618.388af8","type":"ioBroker out","z":"4c6baea6.cd3f4","name":"volume","topic":"alexa2.0.Echo-Devices.GJJ7887VGHH87ZZ.Player.volume","ack":"false","autoCreate":"false","x":520,"y":980,"wires":[]},{"id":"ded75bd1.e04798","type":"ioBroker in","z":"4c6baea6.cd3f4","name":"currentState","topic":"alexa2.0.Echo-Devices.GJJ7887VGHH87ZZ.Player.currentState","payloadType":"value","onlyack":"","func":"all","gap":"","x":120,"y":1120,"wires":[["c916d16f.a150c"]]},{"id":"c916d16f.a150c","type":"mqtt out","z":"4c6baea6.cd3f4","name":"","topic":"alexa/mobile_state","qos":"","retain":"","broker":"8a37d0c6.f5ee5","x":350,"y":1120,"wires":[]},{"id":"67313ce2.7a49d4","type":"mqtt in","z":"4c6baea6.cd3f4","name":"","topic":"alexa/mobile","qos":"2","datatype":"auto","broker":"8a37d0c6.f5ee5","x":140,"y":1040,"wires":[["c8f95e56.2f9b1"]]},{"id":"904ab27d.49c74","type":"change","z":"4c6baea6.cd3f4","name":"Number","rules":[{"t":"set","p":"payload","pt":"msg","to":"$number(payload)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":980,"wires":[["a0748618.388af8"]]},{"id":"724fd70a.f5f438","type":"ioBroker out","z":"4c6baea6.cd3f4","name":"controlPlay","topic":"alexa2.0.Echo-Devices.GJJ7887VGHH87ZZ.Player.controlPlay","ack":"false","autoCreate":"false","x":520,"y":1020,"wires":[]},{"id":"c8f95e56.2f9b1","type":"switch","z":"4c6baea6.cd3f4","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":290,"y":1040,"wires":[["724fd70a.f5f438"],["85ec9a7f.2eaff8"]]},{"id":"85ec9a7f.2eaff8","type":"ioBroker out","z":"4c6baea6.cd3f4","name":"controlPause","topic":"alexa2.0.Echo-Devices.GJJ7887VGHH87ZZ.Player.controlPause","ack":"false","autoCreate":"false","x":520,"y":1060,"wires":[]},{"id":"88c1d58c.1fac38","type":"ioBroker in","z":"4c6baea6.cd3f4","name":"radioStationId","topic":"alexa2.0.Echo-Devices.GJJ7887VGHH87ZZ.Player.radioStationId","payloadType":"value","onlyack":"","func":"all","gap":"","x":120,"y":1200,"wires":[["65d81ad2.84cf04"]]},{"id":"65d81ad2.84cf04","type":"mqtt out","z":"4c6baea6.cd3f4","name":"","topic":"alexa/mobile_radiostation_id","qos":"","retain":"","broker":"8a37d0c6.f5ee5","x":380,"y":1200,"wires":[]},{"id":"17706df5.bc3802","type":"mqtt in","z":"4c6baea6.cd3f4","name":"","topic":"alexa/mobile_radio_station","qos":"2","datatype":"auto","broker":"8a37d0c6.f5ee5","x":110,"y":1240,"wires":[["da6d1951.b04128"]]},{"id":"da6d1951.b04128","type":"ioBroker out","z":"4c6baea6.cd3f4","name":"TuneIn-Station","topic":"alexa2.0.Echo-Devices.GJJ7887VGHH87ZZ.Player.TuneIn-Station","ack":"false","autoCreate":"false","x":360,"y":1240,"wires":[]},{"id":"7eac59a8.e41548","type":"comment","z":"4c6baea6.cd3f4","name":"Flow für den Export von ioBroker AlexaPlugin nach MQTT","info":"","x":230,"y":860,"wires":[]},{"id":"37775b15.22ebc4","type":"virtualHomee","z":"","name":"virtualHomee01"},{"id":"db0ac03f.e4ae2","type":"mqtt-broker","z":"","name":"","broker":"10.1.103.120","port":"1883","clientid":"NanoPiCube","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","willTopic":"","willQos":"0","willRetain":"false","willPayload":""},{"id":"8a37d0c6.f5ee5","type":"mqtt-broker","z":"","name":"","broker":"10.1.103.120","port":"1883","clientid":"Raspberry4","usetls":false,"compatmode":true,"keepalive":"10","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","willTopic":"","willQos":"0","willRetain":"false","willPayload":""}]