I found some odd behaviour in the websockets and i cant find any documentation about it. Trying to set a number value via websockets at the moment, i have success doing other service calls like sending my vacuum cleaner somewhere (via websockets)
So posting /api/states/number.entity_id with {state: 42.5} works fine, but calling the service's from the websocket:
{
"type": "call_service",
"domain": "input_number",
"service": "set_value",
"service_data": {
"value": 42.5
},
"target": {
"entity_id": "input_number.your_entity_id"
}
}
fail to do anything, while i do get a context block back, i dont get any actual state difference's
I tried to look at the websocket lib of home assistant and i cant find anything using the set_value, so i guess its not used? But when i get all the services, it says it is supported
{
// (...)
"input_number": {
"set_value" : {
"name" : "Set",
"description" : "Sets the value.",
"fields" : {
"value" : {
"required" : true,
"selector" : {
"number" : {
"min" : 0,
"max" : 9223372036854776000,
"step" : 0.001,
"mode" : "box"
}
},
"name" : "Value",
"description" : "The target value."
}
},
"target" : {
"entity" : [ {
"domain" : [ "input_number" ]
} ]
}
}
}
// (...)
}
So that indicates it should work like this. My work around right now is to just use the API, but i prefer to use the websockets 🙂