Just because I’m curious, I also can’t get the debug info in the detailed way… how do I get all the info?
Not sure if this helps
- Drag out the Debug node
- Connect the debug node to where you want to intercept data.
- Run your flow so data flows through your circuit you want to see.
- In the debug window on the right side you should see the data.
- Note some of the data needs to be expanded with the arrows such as my Xiaomi buttons when I click on them.
Hey mate, sorry it’s been awhile, just checking…
Does your original flow still work for you with setting the volume back to the original volume?
I glued a Xiaomi push button next to my front door as door bell and using it to play doorbell mp3s on my google homes.
It sets the volume fine but doesn’t return the volume to the previous volume.
[{"id":"219d9dc2.09e732","type":"debug","z":"d1ff6d76.b90a8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":2430,"y":1600,"wires":[]},{"id":"3a0c0487.a8836c","type":"cast-to-client","z":"d1ff6d76.b90a8","name":"Playroom","url":"http://192.168.86.229:8123/local/doorbell.mp3","contentType":"audio","message":"","language":"en","ip":"192.168.86.40","port":"","volume":"","x":2360,"y":1680,"wires":[[]]},{"id":"5401f546.dec15c","type":"api-call-service","z":"d1ff6d76.b90a8","name":"Set volume to 20%","server":"a661f859.8644a8","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"media_player.googlehome4405","data":"{\"volume_level\":0.2}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1910,"y":1600,"wires":[["ada484de.1a9d58"]]},{"id":"4f748a5f.6c30c4","type":"switch","z":"d1ff6d76.b90a8","name":"20%?","property":"data.attributes.volume_level","propertyType":"msg","rules":[{"t":"neq","v":"0.2","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":1610,"y":1600,"wires":[["5bec789d.b19d48","5401f546.dec15c"]]},{"id":"5a1e3c83.7c7e24","type":"api-current-state","z":"d1ff6d76.b90a8","name":"Playroom Speaker","server":"a661f859.8644a8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"media_player.googlehome4405","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1430,"y":1600,"wires":[["4f748a5f.6c30c4"]]},{"id":"5bec789d.b19d48","type":"function","z":"d1ff6d76.b90a8","name":"","func":"msg.payload =\n{\n \"data\":{\n \"entity_id\":\"media_player.garage_speaker\",\n \"volume_level\": msg.data.attributes.volume_level\n }\n}\nreturn msg;","outputs":1,"noerr":0,"x":1610,"y":1660,"wires":[["422b3aef.040814"]]},{"id":"98acbd33.2546c","type":"api-call-service","z":"d1ff6d76.b90a8","name":"Set volume to Previous","server":"a661f859.8644a8","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"media_player.googlehome4405","data":"{}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1970,"y":1660,"wires":[[]]},{"id":"ada484de.1a9d58","type":"change","z":"d1ff6d76.b90a8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2132,"y":1599,"wires":[["3a0c0487.a8836c","219d9dc2.09e732"]]},{"id":"422b3aef.040814","type":"delay","z":"d1ff6d76.b90a8","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1760,"y":1660,"wires":[["98acbd33.2546c"]]},{"id":"a661f859.8644a8","type":"server","z":"","name":"HA - Default","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]
ps I chose the cast node at the end as I am using .mp3 rather than tts.
Hey bud,
I’ve been out of the home assistant scene for a while, since we were waiting for our new home to be built. Got HA up and running last week but haven’t implemented any major automations yet, so can’t say if these are working for me or not.
If I get a chance to experiment, I’ll let you know.
Hey,
Did you ever find a solution for this?
I am in need of the exact same thing myself.
I have tried checking for state change to identify when the TTS is done, but I cannot seem to find any clear identification for this.
Unfortunately not. I stopped searching for a soluation short after, but I would definitely be thankful for any ideas.
Allright, good to know.
My plan B now is to try a couple of different messages with different lengths and try to extrapolate the average speech length for a certain length in the message string.
This will obviously vary with different voices and languages, as well as what TTS engine, being used, but I don’t know any other way. I also think it might work well enough, especially if one add a small static delay of 500 milliseconds after the calculated speech length as a buffer.
I’ll make sure to post my flow here when I have tried my hand at this.
I’m a newbie in node-red, and I’d like to implement exactly what is in this topic. When the garage door opens, I’d like to have a notification on one of my cast device. I could manage it, works great. No I want to handle the volume. Store the current, set it on a different and set back to the tored original. I saw storing is possible with the “function” node. Could somebody make a screenshot how the node set up to store “{{data.attributes.volume_level}}” and also screenshot on set the previous volume in a call service node?
I have the state node “current_state: media_player.kitchen_display”, wich gives “{{data.attributes.volume_level}}”.
Thanks a lot! So I have the current state. If I’m right “vana_magata” is the variable for the volume. So the volume is stored in “vana_magata”.
To be honest, I’m still not clear
Can you please post the window screenshot of the “Function” node and the “Call service node” whict sets back to the original?
service node and data part:
{ "volume_level": {{flow.vana_laud.attributes.volume_level}}}
and i’m not using function node at all.
sorry screenshots are from different flows, but you should use flow.yourname
Hi, how did you get that output?
This is my flow:
[{"id":"f0e4ec9b.c55fd","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"17f121a5.e5dcce","type":"inject","z":"f0e4ec9b.c55fd","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"on","payloadType":"str","x":970,"y":160,"wires":[["fcb04c1c.2d1d5"]]},{"id":"e555f204.9b437","type":"debug","z":"f0e4ec9b.c55fd","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1250,"y":160,"wires":[]},{"id":"fcb04c1c.2d1d5","type":"api-current-state","z":"f0e4ec9b.c55fd","name":"g mini","server":"46a5f96a.e810e8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.family_room_speaker","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1120,"y":160,"wires":[["e555f204.9b437"]]},{"id":"46a5f96a.e810e8","type":"server","name":"Home Assistant","addon":true}]
This is the output I get:
play something on mediaplayer and look then debug
You don’t need to play anything, just media_player.turn_on, delay 1 second, read state.
I can’t seem to figure out how to set the volume back to the original.
i tried using a call service node with {} or with
{ “volume_level”: {{flow.var_name.attributes.volume_level}}} but they don’t work
here’s my flow:
[{"id":"7c674098.d55c5","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"a7d38d89.b4e6c","type":"inject","z":"7c674098.d55c5","name":"on","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"on","payloadType":"str","x":130,"y":140,"wires":[["34b58a78.b34546"]]},{"id":"34b58a78.b34546","type":"api-current-state","z":"7c674098.d55c5","name":"get g mini volume","server":"46a5f96a.e810e8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.family_room_speaker","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"pv","override_data":"flow","blockInputOverrides":false,"x":310,"y":140,"wires":[["22aacf64.76577"]]},{"id":"22aacf64.76577","type":"api-call-service","z":"7c674098.d55c5","name":"set vol to 2","server":"46a5f96a.e810e8","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"media_player.family_room_speaker","data":"{\"entity_id\":\"media_player.family_room_speaker\",\"volume_level\":\"0.2\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":530,"y":140,"wires":[["d3a8f8df.d3d6c8"]]},{"id":"a22baf68.c7974","type":"api-current-state","z":"7c674098.d55c5","name":"g mini","server":"46a5f96a.e810e8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.family_room_speaker","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":730,"y":140,"wires":[["16a8ad2d.3c71e3","65c9b612.874e88"]]},{"id":"16a8ad2d.3c71e3","type":"api-call-service","z":"7c674098.d55c5","name":"set original vol","server":"46a5f96a.e810e8","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"media_player.family_room_speaker","data":"{ \"volume_level\": {{flow.pv.attributes.volume_level}}}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":920,"y":140,"wires":[["7b97a19e.ae5b9"]]},{"id":"7b97a19e.ae5b9","type":"api-current-state","z":"7c674098.d55c5","name":"g mini","server":"46a5f96a.e810e8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.family_room_speaker","state_type":"str","state_location":"","override_payload":"none","entity_location":"PrevVolume","override_data":"flow","blockInputOverrides":false,"x":1170,"y":140,"wires":[["e99c160e.9b2f98"]]},{"id":"65c9b612.874e88","type":"debug","z":"7c674098.d55c5","name":"msg1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"data.attributes.volume_level","targetType":"msg","statusVal":"","statusType":"auto","x":810,"y":60,"wires":[]},{"id":"e99c160e.9b2f98","type":"debug","z":"7c674098.d55c5","name":"msg2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1150,"y":60,"wires":[]},{"id":"d3a8f8df.d3d6c8","type":"delay","z":"7c674098.d55c5","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":600,"y":220,"wires":[["a22baf68.c7974"]]},{"id":"46a5f96a.e810e8","type":"server","name":"Home Assistant","addon":true}]
the initial volume is set to 0.1, msg1 returns 0.2 and msg2 returns 0.2 and I’m expecting msg2 to return 0.1
What do you think?
This is part of my flow that does the same.
[{"id":"be398e2b.a6e67","type":"ha-wait-until","z":"7c674098.d55c5","name":"","server":"4bbca37b.1700ec","outputs":2,"entityId":"{{device}}","entityIdFilterType":"exact","property":"state","comparator":"is","value":"idle","valueType":"str","timeout":"10","timeoutType":"num","timeoutUnits":"seconds","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":1640,"y":400,"wires":[["165479c9.c11d16"],["165479c9.c11d16"]]},{"id":"d2b56f3e.a2323","type":"delay","z":"7c674098.d55c5","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1480,"y":400,"wires":[["be398e2b.a6e67"]]},{"id":"165479c9.c11d16","type":"api-call-service","z":"7c674098.d55c5","name":"","server":"4bbca37b.1700ec","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"{{device}}","data":"{\"entity_id\":\"{{device}}\",\"volume_level\":\"{{prev_volume}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1870,"y":400,"wires":[[]]},{"id":"77b87f10.c2e03","type":"api-call-service","z":"7c674098.d55c5","name":"Speak message","server":"4bbca37b.1700ec","version":1,"debugenabled":false,"service_domain":"tts","service":"cloud_say","entityId":"media_player.nedervaningen","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1320,"y":400,"wires":[["d2b56f3e.a2323"]]},{"id":"5a89cddb.d13e94","type":"api-call-service","z":"7c674098.d55c5","name":"","server":"4bbca37b.1700ec","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"{{device}}","data":"{\"entity_id\":\"{{device}}\",\"volume_level\":\"{{volume}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1070,"y":400,"wires":[["77b87f10.c2e03"]]},{"id":"a8b675d1.1f1558","type":"change","z":"7c674098.d55c5","name":"","rules":[{"t":"set","p":"prev_volume","pt":"msg","to":"data.attributes.volume_level","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":400,"wires":[["5a89cddb.d13e94"]]},{"id":"1faa079f.2dc188","type":"api-current-state","z":"7c674098.d55c5","name":"Get previous volume","server":"4bbca37b.1700ec","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"{{device}}","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":560,"y":400,"wires":[["a8b675d1.1f1558"]]},{"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}]
Not sure why you would need it to be a flow variable. But I think the issue is that you don’t have the" "
When you see your json like this when you open it, something is wrong.
After editing it to and clicking done:
and opening it again you see the formatting is “correct” again.
and the red border is gone from here:
Hi
trying to copy your flow, can you let me know what was in your set.msg_payload?
edit: just saw your flow … thanks
Thanks
Fred
Here you have a node that let you set the announcement volume and after the voice message is played the initial device volume level is restored.
If you want to give a try here you can find more details about the node:
https://flows.nodered.org/node/node-red-google-notify
If you send a TTS message to a google device while it is casting Spotify from a cell phone for example, the connected device will disconnect, the TTS message will play then the music will not continue playback.
Have you experienced this?
There a couple of threads around like this one TTS Announcements, Google cast, Music - Issues and workaround