Closed bohtho closed 5 years ago
Any comment? I made this new issue after you implemented the new thermostat service and I had tested that version, as per your wish in the other “smarthouse mode” issue.
Anyhow, I happened to read up on breaking changes in HA for developers of custom components just now, and updated HA. The errors now seem to be gone. Shall now test the service (which I see from a commit needed the missing "systems" part).
Yes sorry. Though it would be more obvious why I closed the issue. Anyway, it was a documentation issue. The error above was a issue with 0.89 home assistant. Seems I didn't even read that long. 0.90 should be fine.
Updated and still can't make it work. Sorry.
I get this in the log entry for the set_thermostat service call:
400, message='{
"httpStatusCode": 400,
"errorCode": 1,
"timestamp": "2019-03-15T09:21:23.9567831Z",
"details": [],
"data": null
}'
Traceback (most recent call last):
File "/home/homeassistant/.pyenv/versions/3.6.3/envs/homeassistant-3.6.3/lib/python3.6/site-packages/homeassistant/components/websocket_api/commands.py", line 148, in handle_call_service
connection.context(msg))
File "/home/homeassistant/.pyenv/versions/3.6.3/envs/homeassistant-3.6.3/lib/python3.6/site-packages/homeassistant/core.py", line 1133, in async_call
self._execute_service(handler, service_call))
File "/home/homeassistant/.pyenv/versions/3.6.3/envs/homeassistant-3.6.3/lib/python3.6/site-packages/homeassistant/core.py", line 1155, in _execute_service
await handler.func(service_call)
File "/home/homeassistant/.homeassistant/custom_components/nibe/services.py", line 52, in set_thermostat
data)
File "/home/homeassistant/.pyenv/versions/3.6.3/envs/homeassistant-3.6.3/lib/python3.6/site-packages/nibeuplink/__init__.py", line 602, in post_smarthome_thermostats
headers=headers)
File "/home/homeassistant/.pyenv/versions/3.6.3/envs/homeassistant-3.6.3/lib/python3.6/site-packages/nibeuplink/__init__.py", line 361, in post
**kwargs
File "/home/homeassistant/.pyenv/versions/3.6.3/envs/homeassistant-3.6.3/lib/python3.6/site-packages/nibeuplink/__init__.py", line 378, in _request
await raise_for_status(response)
File "/home/homeassistant/.pyenv/versions/3.6.3/envs/homeassistant-3.6.3/lib/python3.6/site-packages/nibeuplink/__init__.py", line 182, in raise_for_status
headers=response.headers)
aiohttp.client_exceptions.ClientResponseError: 400, message='{
"httpStatusCode": 400,
"errorCode": 1,
"timestamp": "2019-03-15T09:21:23.9567831Z",
"details": [],
"data": null
}'
This was the JSON I sent in the data (just my system number instead of xxxxx):
{
"system": xxxxx,
"id": 1,
"name": "test room",
"systems": [1],
"temperature": 20,
"target_temperature": 21,
"valve_position": 15
}
Hmm it's being rejected. Weird. What if you don't specify a valve position?
Its the same without valve_position. And the same with a new higher id every time.
But you can use the thermostat entities?
Wait, you selected the write access checkbox when you set up the integration?
How can I check that ?
I did earlier when the component used to be configured in the configuration.yaml. And then I upgraded the component where system id etc was set afterwards in HA integrations. And I can still use the hot_water_boost switch. Wouldn’t that require write access ?
Hot water boost does require write, so you probably have it then.
Termostat is not climate, it's smart thermostats. Look at docs about how to add a smart thermostat (you need a temp senor or a dummy input_number entity) for current temp.
No, I'm calling your "nibe.set_thermostat" service directly with the data in a json. Its example data includes valves etc. It’s supposed to be the smart home thermostats in Uplink.
Anyone else getting it to work? Remember, you don’t have to have “Smart home” under your NIBE settings activated to test the smart home thermostats in Uplink. IFTTT sends smart home thermostat data to Uplink->Smart home->Thermostats anyway.
Well I asked you to try with the termostat function instead of the service.
Anyway I think it is fixed. Forgot to scale temperatures.
Just pulled the latest version of this integration, and tried the new set_thermostat service. Tried to call it with the JSON (xxxxx replaced with my system):
{ "system": "xxxxx", "id": "1", "name": "stue", "temperature": "21.2", "target_temperature": "18.0", "valve_position": "0" }
Both from the Node-Red Homeassistant-websocket "call service" node, AND from the developer tool to call services in HA. From Node-Red all I could see was "API error from Home Assistant: Invalid Format" and in HA the developer tool just said it couldn't call the service.
I tried to send the numbers as floats and integers instead of strings but no change. Any idea ?
Also: The entities for S1 Room and S1 Supply seem to have vanished(?). The States UI now has a card that says "Invalid config":
The log shows a maybe relevant entry as well: