Closed salopette closed 4 years ago
Sure, I have already started this part. But have you the previous line ? the websocket return, the request result (just before the error message) or json from api for I simulate your device ?
If I m right you already have 2 device for it ? 1 thermostat and 1 temperature sensor ? or it crash before creation ?
here is the whole log, after which I restart Deconz plugin.
2 devices are found, temperature and setpoint.
I can currently read temperature, only setpoint does not work
2019-10-09 18:28:00.126 Error: (deconz) Device not ready : 110
2019-10-09 18:36:07.671 Status: (deconz) ### deCONZ ready 2019-10-09 18:36:07.671 Status: (deconz) ### Found 63 Operators, 43 Sensors, 20 Groups, 4 Scenes and 0 others, with 0 Ignored 2019-10-09 18:36:07.672 Status: (deconz) ### Device 00:15:8d:00:01:92:38:83-01-0201_heatsetpoint(deconz - SPZB0001) Not in deCONZ ATM, the device is deleted or not ready. 2019-10-09 18:36:07.751 Status: (deconz) Launching websocket on port 443 2019-10-09 18:36:07.603 Error: (CDevice_update) deconz - SPZB0001: Failed to parse parameters: 'nValue', 'sValue', 'Image', 'SignalLevel', 'BatteryLevel', 'Options', 'TimedOut', 'Name', 'TypeName', 'Type', 'Subtype', 'Switchtype', 'Used', 'Description', 'Color' or 'SuppressTriggers' expected. 2019-10-09 18:36:07.603 Error: (deconz) 'CDevice_update' failed 'TypeError':'an integer is required (got type str)'. 2019-10-09 18:36:07.672 Error: (deconz) Process request take too much time : 1.0720579624176025 s
Here I have something to thermostat found, maybe that helps?
IDK yet, but for the moment I have found your problem, string instead of int. I m making a correctif.
Update device (deconz - SPZB0001) : {'nValue': '24.0', 'BatteryLevel': 100, 'sValue': '21.67'}
I need to find why you have '24.0' as value.
I have perhaps find the problem, I think 24°C is you heatpoint value ? plugin.py ligne 964
kwarg['nValue'] = str(v)
To change in
kwarg['sValue'] = str(v)
I m sure it's a bug, but I can't reproduce the bug with your logs. Try with this modification first pls.
I can't understand why you havent 'heatsetpoint' in websocket return.
Haa, I know ^^, this value is in config part, not state, it's for that it's not displayed in logs.
cool! Let me know if I should test it!
Sure, you can. IDK if it will work, but no more error message ^^. When this part will work, if you think it can be usefull, I can too add a thirst device to select mode, 1 device for heatpoint + 1 device for temperature + 1 switch for mode. But idk if it can be usefull.
just tried it, setpoint is not working.
If I set the temp on the thermostat, the values will be transmitted, but if I want to change setpoint in domoticz, it will not forward it to the thermostat.
2019-10-09 21:16:26.726 (deconz) onCommand called for Unit 103: Parameter 'Set Level', Level: 23.5, Hue: 2019-10-09 21:16:26.779 Error: (deconz) Connexion problem (1) with Gateway : 400 2019-10-09 21:16:41.902 (RFLink-Getway) Temp + Humidity (Aussen) 2019-10-09 21:16:58.979 (deconz) onCommand called for Unit 103: Parameter 'Set Level', Level: 23.5, Hue: 2019-10-09 21:16:59.011 Error: (deconz) Connexion problem (1) with Gateway : 400 2019-10-09 21:17:21.504 (Mi Alarmanlage) Color Switch (Xiaomi RGB Küche) 2019-10-09 21:17:21.532 (Mi Alarmanlage) Lux (Küche Gateway Lux) 2019-10-09 21:17:40.903 (RFLink-Getway) Temp + Humidity (Aussen) 2019-10-09 21:17:44.365 (deconz) onCommand called for Unit 103: Parameter 'Set Level', Level: 23.0, Hue: 2019-10-09 21:17:44.384 Error: (deconz) Connexion problem (1) with Gateway : 400 2019-10-09 21:17:52.548 (deconz) onCommand called for Unit 103: Parameter 'Set Level', Level: 27.0, Hue: 2019-10-09 21:17:52.574 Error: (deconz) Connexion problem (1) with Gateway : 400
the setpoint in Domoticz must send the value change to the thermostat and also receive the value change from the thermostat
I have something wrong in the request
If you enable log you will have a line like this one
2019-10-09 22:22:15.981 (deCONZ) Send Command /api/36E138295E/lights/9/state with {'bri': 254, 'on': True} (0 in buffer)
Can you show me the one just before the error 400
2019-10-09 21:16:26.779 Error: (deconz) Connexion problem (1) with Gateway : 400
It will be something like
/api/XXXX/sensors/48/config with {'mode':'auto;'heatsetpoint':'24'}
And yep, you are right, when you set it, domoticz send the value to deconz (ATM it's the bugged part with error 400) but domoticz can read the value too, when you synchronise them or by webscoket notification at every changes.
I have now setpoint to 27 degrees.
2019-10-10 08:46:31.770 (deconz) onCommand called for Unit 103: Parameter 'Set Level', Level: 27.0, Hue: 2019-10-10 08:46:31.771 Error: (deconz) Device not ready : 103 2019-10-10 08:46:32.222 (deconz) Received 150 bytes of data
2019-10-10 08:54:03.884 Status: (deconz) ### deCONZ ready 2019-10-10 08:54:03.884 Status: (deconz) ### Found 63 Operators, 43 Sensors, 20 Groups, 4 Scenes and 0 others, with 0 Ignored 2019-10-10 08:54:03.885 Status: (deconz) ### Device 00:15:8d:00:01:92:38:83-01-0201_heatsetpoint(deconz - SPZB0001) Not in deCONZ ATM, the device is deleted or not ready. 2019-10-10 08:54:03.927 Status: (deconz) Launching websocket on port 443 2019-10-10 08:54:03.886 Error: (deconz) Process request take too much time : 1.0986127853393555 s 2019-10-10 08:54:08.032 (deconz) onCommand called for Unit 103: Parameter 'Set Level', Level: 23.0, Hue: 2019-10-10 08:54:08.032 Error: (deconz) Device not ready : 103
"48":{"config":{"battery":100,"displayflipped":null,"heatsetpoint":2150,"locked":null,"mode":"auto","offset":0,"on":true,"reachable":true},"ep":1,"etag":"260b246d2f026cf7a7e6979b06d81913","manufacturername":"Eurotronic","modelid":"SPZB0001","name":"SPZB0001","state":{"lastupdated":"2019-10-10T06:43:01","on":true,"temperature":2131,"valve":36},"swversion":"20190408","type":"ZHAThermostat","uniqueid":"00:15:8d:00:01:92:38:83-01-0201"}
You was too fast ^^, you set a temperature before the plugin was ready. BTW you have a new bug 2019-10-10 08:46:31.771 Error: (deconz) Device not ready : 103 2019-10-10 08:54:03.885 Status: (deconz) ### Device 00:15:8d:00:01:92:38:83-01-0201_heatsetpoint(deconz - SPZB0001) Not in deCONZ ATM, the device is deleted or not ready.
It seem the thermostat was not created this time (it will be by next correction in few hours)
And no more error 400 ?
It indicates that it is not ready, but if I change the temperature on the device, it will be sent to Domoticz.
I do not know any further?
or can the thermostat not receive any commands? But only send?
I also have no values in iobroker
Here with Zigbee2Mqtt
Could that be the Dconz does not capture all values from the thermostat?
I have make a new version > https://github.com/Smanar/Domoticz-deCONZ/commit/48e0d76754fc42547061882503893b35e13c75fc#diff-66c71ea3faaa52c277917c951aa67921
With this version you will have the 2 sensor (temperature+thermostat) added and updated just one after the other It will remove
2019-10-10 08:46:31.771 Error: (deconz) Device not ready : 103 2019-10-10 08:54:03.885 Status: (deconz) ### Device 00:15:8d:00:01:92:38:83-01-0201_heatsetpoint(deconz - SPZB0001) Not in deCONZ ATM, the device is deleted or not ready.
So now you will have the error 400 and with it I hope the bad request.
The thermostat can send and receive command from my memory (from deconz issue), I will check again.
BTW if you wana try the command I want to use with deconz, you can test with curl
curl -H 'Content-Type: application/json' -X PUT -d '{"heatsetpoint": 2200,"mode":"auto"}' http://IP_deconz:Port/api/API_KEY/sensors/48/config
From your log, I think your device have the id 48
2019-10-10 19:36:19.841 (deconz) ### Device > 48 Name:SPZB0001 Type:ZHAThermostat Details:{'temperature': 2060, 'valve': 255, 'on': True, 'lastupdated': '2019-10-10T17:36:12'} and {'heatsetpoint': 2650, 'locked': None, 'offset': 0, 'battery': 100, 'displayflipped': None, 'on': True, 'mode': 'auto', 'reachable': True}
2019-10-10 19:37:03.071 (deconz) onCommand called for Unit 103: Parameter 'Set Level', Level: 28.0, Hue: 2019-10-10 19:37:03.097 Error: (deconz) Connexion problem (1) with Gateway : 400
http://192.168.178.93/api/7B77BF4B99/sensors/48/config
[{"error":{"address":"/sensors/48/config","description":"resource, /sensors/48/config, not available","type":3}}]
http://192.168.178.93/api/7B77BF4B99/sensors/48
{"config":{"battery":100,"displayflipped":null,"heatsetpoint":2650,"locked":null,"mode":"auto","offset":0,"on":true,"reachable":true},"ep":1,"etag":"108701603ce0222db3fd0c116e00e4f3","manufacturername":"Eurotronic","modelid":"SPZB0001","name":"SPZB0001","state":{"lastupdated":"2019-10-10T17:36:12","on":true,"temperature":2060,"valve":255},"swversion":"20190408","type":"ZHAThermostat","uniqueid":"00:15:8d:00:01:92:38:83-01-0201"}
Nice, it's better. But you haven't something like that in log ?
2019-10-09 22:22:15.981 (deCONZ) Send Command /api/36E138295E/lights/9/state with {'bri': 254, 'on': True} (0 in buffer)
Just beetween theses 2 lines ? (perhaps need more log level)
2019-10-10 19:37:03.071 (deconz) onCommand called for Unit 103: Parameter 'Set Level', Level: 28.0, Hue:
2019-10-10 19:37:03.097 Error: (deconz) Connexion problem (1) with Gateway : 400
The curl command don't working ?
curl -H 'Content-Type: application/json' -X PUT -d '{"heatsetpoint": 2200,"mode":"auto"}' http://192.168.178.93/api/7B77BF4B99/sensors/48/config
that's working!!! The value is changed at the thermostat!
curl -H 'Content-Type: application/json' -X PUT -d '{"heatsetpoint": 2200,"mode":"auto"}' http://192.168.178.93/api/7B77BF4B99/sensors/48/config
Ok, so good news but I don't understand why it's not working by deconz. I m doing (trying at least) to make the same command. If you find the line starting by "(deCONZ) Send Command" you will read exactly the command I m making so you can compare it with this one (perhaps you need to enable more log level, but On my side I have them with "debug info only")
2019-10-10 19:54:53.447 (deconz) onCommand called for Unit 103: Parameter 'Set Level', Level: 29.0, Hue: 2019-10-10 19:54:53.448 (deconz) Send Command /api/7B77BF4B99/sensors/48/config with {'heatsetpoint': 29.0, 'mode': 'auto'} (0 in buffer) 2019-10-10 19:54:53.448 (deconz) Making Request : http://192.168.178.93:80/api/7B77BF4B99/sensors/48/config with params {'heatsetpoint': 29.0, 'mode': 'auto'} 2019-10-10 19:54:53.479 Error: (deconz) Connexion problem (1) with Gateway : 400 2019-10-10 19:54:54.431 (deconz) onHeartbeat called
I think config is too much? or blank?
http://192.168.178.93 : 80 / api / 7B77BF4B99 / sensors / 48 / config
Haa, perhaps the value 29.0 on my code and 2200 on your try.
If you try
curl -H 'Content-Type: application/json' -X PUT -d '{"heatsetpoint": 29.0,"mode":"auto"}' http://192.168.178.93/api/7B77BF4B99/sensors/48/config
Or perhaps the port :80
I don't think it' s a synstax problem because it works on other com
pi@raspberrypi:~ $ curl -H 'Content-Type: application/json' -X PUT -d '{"heatsetpoint": 29.0,"mode":"auto"}' http://192.168.178.93/api/7B77BF4B99/sensors/48/config [{"error":{"address":"/sensors/48/config/heatsetpoint","description":"invalid value, 29, for parameter heatsetpoint","type":7}}]pi@raspberrypi:~ $
pi@raspberrypi:~ $ curl -H 'Content-Type: application/json' -X PUT -d '{"heatsetpoint": 2900,"mode":"auto"}' http://192.168.178.93/api/7B77BF4B99/sensors/48/config [{"success":{"/sensors/48/config/heatsetpoint":2900,"/sensors/48/config/mode":"auto"}}]pi@raspberrypi:~ $
Yeah ^^, thx a lot. I m going to eat but you can try
plugin.py line 250
_json['heatsetpoint'] = Level
To remplace by
_json['heatsetpoint'] = Level * 100
Enjoy your meal!!!
It works!
We can now continue with lights groups? These are a few mistakes! But only if you're free!
You have problems with light groups ?
Yes, if the lamps are in a group and I change the slider for brightness, the light is dimmed, but the lider goes back to 0%. For the individual lamps themselves, the slider bends to the set level!
You have this bug all the time ? I have this bug only if all bulbs are off and if I set a dimmer value, slider bulbs will be ok, but group slider return to previous value.
But on normal working mode, lights always on, slider is working fine ?
yes that is always.
It perhaps due to your configuration. But where this situation can be a problem ? It's a little bit complicated because you can use a group device to send group command, but you can't use a group device to see a bulbs situation. The group device doen't reflect bulbs states.
For exemple in the same group you can have 1 bulb at 50%, 1 bulb off and 1 bulb on, if you set them one by one, so I can't set a "global state" for the device group. But if you set the group device at on, 50%, all bulbs on the group will be set on at 50% It works only in one way. It's for that my code don't manage that.
ok, then i have to live with it. I just thought it could be a mistake.
Lol, "live with it", It's goods words, If you have a situation where it can be a problem tell me, but for the moment I don't have a problem with that yet.
BTW it's possible too adding a selector switch to set "mode" on thermostat, but IDK if it's something usefull ?
What do you mean with selector switch?
That looks like this now.
Nope a new one, with somes button like "Auto" "heat" "off". But idk if it s something usefull ?
Sure, if you do not mind! I am open for new things!
New version on beta. Happy testing ^^.
2019-10-11 20:46:15.206 Status: (deconz) Firmware version : 0x26490700 2019-10-11 20:46:15.206 Status: (deconz) Websocketnotifyall : True 2019-10-11 20:46:15.842 Status: (deconz) Launching websocket on port 443 2019-10-11 20:46:15.790 Error: (deconz) 'onHeartbeat' failed 'AttributeError':''Domoticz.Device' object has no attribute 'mode''. 2019-10-11 20:46:15.790 Error: (deconz) ----> Line 849 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function onHeartbeat 2019-10-11 20:46:15.790 Error: (deconz) ----> Line 345 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function onHeartbeat 2019-10-11 20:46:15.790 Error: (deconz) ----> Line 402 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function ManageInit 2019-10-11 20:46:15.790 Error: (deconz) ----> Line 745 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function SendCommand 2019-10-11 20:46:15.790 Error: (deconz) ----> Line 786 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function UpdateBuffer 2019-10-11 20:46:15.790 Error: (deconz) ----> Line 534 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function NormalConnexion 2019-10-11 20:46:15.790 Error: (deconz) ----> Line 613 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function ReadConfig 2019-10-11 20:46:15.790 Error: (deconz) ----> Line 402 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function ManageInit 2019-10-11 20:46:15.790 Error: (deconz) ----> Line 745 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function SendCommand 2019-10-11 20:46:15.790 Error: (deconz) ----> Line 786 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function UpdateBuffer 2019-10-11 20:46:15.790 Error: (deconz) ----> Line 543 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function NormalConnexion 2019-10-11 20:46:15.790 Error: (deconz) ----> Line 402 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function ManageInit 2019-10-11 20:46:15.790 Error: (deconz) ----> Line 745 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function SendCommand 2019-10-11 20:46:15.791 Error: (deconz) ----> Line 786 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function UpdateBuffer 2019-10-11 20:46:15.791 Error: (deconz) ----> Line 540 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function NormalConnexion 2019-10-11 20:46:15.791 Error: (deconz) ----> Line 486 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function InitDomoticzDB 2019-10-11 20:46:15.791 Error: (deconz) ----> Line 971 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function UpdateDevice 2019-10-11 20:46:15.791 Error: (deconz) ----> Line 1009 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function UpdateDeviceProc 2019-10-11 20:46:21.725 Error: (deconz) deCONZ not ready
nothing works now :-)
Ups, 10mn
It will not solve the problem, but with it your installation will work
I think there is some device with 'mode 'field' that are not thermostat.
2019-10-11 21:09:20.322 Status: (deconz) Firmware version : 0x26490700 2019-10-11 21:09:20.322 Status: (deconz) Websocketnotifyall : True 2019-10-11 21:09:20.898 Status: (deconz) Launching websocket on port 443 2019-10-11 21:09:20.845 Error: (deconz) 'onHeartbeat' failed 'AttributeError':''dict' object has no attribute 'remove''. 2019-10-11 21:09:20.845 Error: (deconz) ----> Line 849 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function onHeartbeat 2019-10-11 21:09:20.845 Error: (deconz) ----> Line 345 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function onHeartbeat 2019-10-11 21:09:20.845 Error: (deconz) ----> Line 402 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function ManageInit 2019-10-11 21:09:20.845 Error: (deconz) ----> Line 745 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function SendCommand 2019-10-11 21:09:20.845 Error: (deconz) ----> Line 786 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function UpdateBuffer 2019-10-11 21:09:20.845 Error: (deconz) ----> Line 534 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function NormalConnexion 2019-10-11 21:09:20.845 Error: (deconz) ----> Line 613 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function ReadConfig 2019-10-11 21:09:20.845 Error: (deconz) ----> Line 402 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function ManageInit 2019-10-11 21:09:20.845 Error: (deconz) ----> Line 745 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function SendCommand 2019-10-11 21:09:20.845 Error: (deconz) ----> Line 786 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function UpdateBuffer 2019-10-11 21:09:20.845 Error: (deconz) ----> Line 543 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function NormalConnexion 2019-10-11 21:09:20.845 Error: (deconz) ----> Line 402 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function ManageInit 2019-10-11 21:09:20.845 Error: (deconz) ----> Line 745 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function SendCommand 2019-10-11 21:09:20.845 Error: (deconz) ----> Line 786 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function UpdateBuffer 2019-10-11 21:09:20.846 Error: (deconz) ----> Line 540 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function NormalConnexion 2019-10-11 21:09:20.846 Error: (deconz) ----> Line 486 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function InitDomoticzDB 2019-10-11 21:09:20.846 Error: (deconz) ----> Line 971 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function UpdateDevice 2019-10-11 21:09:20.846 Error: (deconz) ----> Line 1009 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function UpdateDeviceProc 2019-10-11 21:09:23.367 Error: (deconz) deCONZ not ready
?? Itworks on my side. replace remove by pop
if 'mode' in kwarg:
kwarg.pop('mode')
if 'heatsetpoint' in kwarg:
kwarg.pop('heatsetpoint')
https://www.amazon.de/gp/product/B077GCDDBY/ref=ppx_yo_dt_b_asin_title_o06_s01?ie=UTF8&psc=1
https://github.com/dresden-elektronik/deconz-rest-plugin/issues/1098
2019-10-09 13:51:47.256 Error: (CDevice_update) deconz - SPZB0001: Failed to parse parameters: 'nValue', 'sValue', 'Image', 'SignalLevel', 'BatteryLevel', 'Options', 'TimedOut', 'Name', 'TypeName', 'Type', 'Subtype', 'Switchtype', 'Used', 'Description', 'Color' or 'SuppressTriggers' expected. 2019-10-09 13:51:47.256 Error: (deconz) 'CDevice_update' failed 'TypeError':'an integer is required (got type str)'.
Hi, I have a thermostat Domoticz does not want to take it? Can you include that?
THX