Evaluating variables redux
-
Sorry for another dumb question. Migrating from Vera Alexa to HASS Vera TTS. MSR is on bare metal, Debian Bullseye version 23049
I can get TTS from MSR and basic TTS from MSR which is great!
Trying to get some of the variables I used to use though is stumping me.
In the original MSR, I'd use:
It is now ${{OutingDays}} days until we go to ${{OutingName}}. , Sleep well!
for example, and that worked fine (I've not bothered to list the variables as I know the worked)
If I use
{ "message":"It is now${{OutingDays}} days until we go to ${{OutingName}}. , Sleep well!", "data":{"type":"announce", "method":"speak"}, "target":["media_player.everywhere"] }
In the data field of the hass service system call it doesn't evaluate the variables (Not really surprised)
So might someone take mercy on me and give me a clue?
TIA
C
-
Substitution isn't done when you launch the action from the Entities page, but it is done when the action is in a Reaction (either global or rule-based).
-
Hmm I am not quite sure what the issue may be here, but maybe Reactor logs would be a bit more telling? See if you can get some logs and post them here. Also what does the service call look if you were to call it in HASS?
@Pabla well running as is it just announces "$days" for example
latest-23049]2023-03-03T22:03:03.654Z <HassController:INFO> HassController#hass action x_hass_system.call_service([Object]{ "service": "notify.alexa_media", "data": "{\n\"message\":\"It is now ${{OutingDays}} days until we go to ${{OutingName}}. , Sleep well!\",\n\"data\":{\"type\":\"announce\", \"method\":\"speak\"},\n\"target\":[\"media_player.everywhere\"]\n}" }) on System#hass>system succeeded
C
-
Substitution isn't done when you launch the action from the Entities page, but it is done when the action is in a Reaction (either global or rule-based).
@toggledbits I think I understand what you mean, however this is from a reaction...
I know this stuff is basic for those of you that write code
C
-
@Pabla well running as is it just announces "$days" for example
latest-23049]2023-03-03T22:03:03.654Z <HassController:INFO> HassController#hass action x_hass_system.call_service([Object]{ "service": "notify.alexa_media", "data": "{\n\"message\":\"It is now ${{OutingDays}} days until we go to ${{OutingName}}. , Sleep well!\",\n\"data\":{\"type\":\"announce\", \"method\":\"speak\"},\n\"target\":[\"media_player.everywhere\"]\n}" }) on System#hass>system succeeded
C
-
@CatmanV2 oh apologies I misunderstood the issue, what toggledbits said is most likely your issue.
-
Use the big play button under set reaction instead of the play button for this specific reaction
-
T toggledbits locked this topic on