Hello guys,
i’m new and i’m starting deploy this project:
Raspberry pi4 whit:
Home Assistant Core
Rhasspy
MagicMirror when all it’s ok.
First i do the IntentHandling of Rhasspy whit HomeAssistant for call a simple automation, and it work all, but now i want more option…like wheater, radio, simple script for do somethings…
so i download nodered, i install the homeassistant node, i connect whit rhasspy (Remote HTTP http://192.168.1.167:1880/intent) and try some on/off light whit a tts back, and it work!!
But now when i try to set brightness_pct or color_name for change color or brightness i recive this error:
“Call-service API error. Error Message: expected float for dictionary value @ data[‘brightness_pct’]”
Configuration of nodered is :
Template Node:
{
“domain”: “light”,
“service”: “turn_on”,
“data”: {
“brightness_pct”: “{{slots.brightness}}”
}
}
(Mustache Template)
(Parsed JSON)
connect whit a simple call service node whit:
server: homeassistant
domain: light
service: turn_on
identity id : light.mylightbulb
i recive the correctly the intent slot brightness from rhasspy
this node is connect to a call services node of the lightbulb…
but always if i remove the “” i recive error:
1/14/2021, 8:39:40 PMnode: SetBrightnessmsg : string[40]
“Unexpected token “ in JSON at position 2”
the mustache format is correct? Parsed JSON also right?
Always the same…i’m sure it’s a stupid syntax error…i’m tired
But yes the quotes change when copyed on the web, i have to replace one by one
but now have this error:
I had the same error when there was no slots.brightness set. I need to see the input into that node to help you with that, pretty sure you are just trying to access a variable that is not there. Put a debug node after your input from rhasspy, set it to complete msg object and post it here.
Honestly I don’t know…
I tried to put value directly in the call service node, in the slot data, but it didn’t work, looking on the web I noticed that, the flows I found all have a template node in front of it, so I thought it was necessary to pass the values…
Sinceyou are an expert on the subject,
do I always need a template node to pass the values to the call service node??
Or can I directly use the data slot of the call service node?
I am in no way an expert at node red, I am barely able to do anything with it. I just found your problem because I tested around and ran into the same error when I used a variable that didn’t exist.
What I did play around with is the change node that can move values around and stuff, but in your case the template node seems easier.