Is it possible to declare part of the msg.data information from within the current state node itself? I have attached a screenshot I what I am trying to do.
msg.orig_volume does not show up in the debug message, despite me declaring it.
Is it possible to declare part of the msg.data information from within the current state node itself? I have attached a screenshot I what I am trying to do.
msg.orig_volume does not show up in the debug message, despite me declaring it.
Do you have the debug node set to show the complete message object?
If you change it from the JSON to pull that volume level data and make it just a string and type TEST
or something in there, then does it show up?
Full disclosure, I’m out of my league here, but just trying to help troubleshoot/diagnose and maybe learn a thing or two myself along the way.
yes it does. I use it frequently for declaring variables for things like alerts. This issue is either you can’t do it, or I am formatting it wrong, and I believe its the latter.
You’ll need to specify which entity to use in the jsonata. $entity().data.attributes.volume_level
. Where entity()
refers to the entity set in the node.
You can also get data from another entity using $entities("entity_name").state
.
You may need to wrap this in $number()
if it comes through as a string. $number($entity().data.attributes.volume_level)
Weird, its still not coming through at all.
Try removing data
so $entity().attributes.volume_level
Hey that worked! Thank you!