-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HA mqtt auto discovery fails partially - HASS: failed to parse 'DS18B20-1' #6447
Comments
Assuming the result of |
Also, paste here the result of |
Thanks for your effort so far. I took a new nodemcu and sensors, because the other one was soldered together. After adding just one sensor first and running SetOption19 1 this was the result as expected in HA. After adding the second sensor, it looked like this. the result of http://192.168.44.108/cm?cmnd=status%200 was {"Status":{"Module":0,"FriendlyName":["Sonoff"],"Topic":"DVES_ED76DA","ButtonTopic":"0","Power":0,"PowerOnState":3,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0},"StatusPRM":{"Baudrate":115200,"GroupTopic":"sonoffs","OtaUrl":"http://thehackbox.org/tasmota/release/sonoff.bin","RestartReason":"Power on","Uptime":"0T00:01:57","StartupUTC":"2019-09-18T18:50:23","Sleep":50,"CfgHolder":4617,"BootCount":11,"SaveCount":23,"SaveAddress":"F6000"},"StatusFWR":{"Version":"6.6.0.12(33baadf-sonoff)","BuildDateTime":"2019-09-10T22:04:34","Boot":31,"Core":"STAGE","SDK":"2.2.2-dev(38a443e)"},"StatusLOG":{"SerialLog":2,"WebLog":4,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["FBI",""],"TelePeriod":300,"Resolution":"558180C0","SetOption":["000A8009","280500000100060000005AFF000000000000","00000200"]},"StatusMEM":{"ProgramSize":558,"Free":444,"Heap":21,"ProgramFlashSize":1024,"FlashSize":4096,"FlashChipId":"164068","FlashMode":2,"Features":["00000809","8FDAE397","003683A0","22B617CD","01001BC0","00000001"],"Drivers":"1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24","Sensors":"1,2,3,4,5,6,7,8,9,10,14,15,17,18,20,22,26,34"},"StatusNET":{"Hostname":"DVES_ED76DA-5850","IPAddress":"192.168.44.108","Gateway":"192.168.44.1","Subnetmask":"255.255.255.0","DNSServer":"192.168.44.11","Mac":"84:F3:EB:ED:76:DA","Webserver":2,"WifiConfig":4},"StatusMQT":{"MqttHost":"192.168.44.11","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_ED76DA","MqttUser":"tasmota","MqttCount":1,"MAX_PACKET_SIZE":1000,"KEEPALIVE":30},"StatusTIM":{"UTC":"Wed Sep 18 18:52:20 2019","Local":"Wed Sep 18 19:52:20 2019","StartDST":"Sun Mar 31 02:00:00 2019","EndDST":"Sun Oct 27 03:00:00 2019","Timezone":"+01:00","Sunrise":"06:30","Sunset":"18:58"},"StatusSNS":{"Time":"2019-09-18T19:52:20","DS18B20-1":{"Id":"000006DDD0F5","Temperature":22.6},"DS18B20-2":{"Id":"01144FEE20AA","Temperature":23.4},"TempUnit":"C"},"StatusSTS":{"Time":"2019-09-18T19:52:20","Uptime":"0T00:01:57","UptimeSec":117,"Heap":22,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"Wifi":{"AP":1,"SSId":"FBI","BSSId":"F0:B0:14:75:BF:2A","Channel":1,"RSSI":48,"LinkCount":1,"Downtime":"0T00:00:05"}}} After that I run setoption19 0 and changed mqtt topic from %topic%/%prefix%/ back to %prefix%/%topic%/ to see if the HA object disappeared, but it stayed the same, except that the entities had an unknown state (did not took a screenshot of that). |
To me it seems that the auto discovery works if you using just 1 sensor. this leads me to the question on how to get rid off unnecessary entities in HA? |
So adding a third sensor (DS18B20-3) in your case, already lead to a parse error (
You can't easily. Is a known issue of Home Assistant auto discovery. The fastest way is to cancel completely all the MQTT autodiscovery you got until now (trash bin on the upper right of the page). Doing that you will loose all he discovery you got so far since it will wipe the DB of MQTT discovery inside HA. I would like to see this log too:
|
continued testing. weblog after restart 11:02:28 APP: Boot Count 36 result of http://192.168.44.108/cm?cmnd=status%200 |
with 5 sensors or more I'am getting the parse error that looks like the one I had in my first post weblog after restart 00:00:00 CFG: Loaded from flash at FA, Count 59 result of http://192.168.44.108/cm?cmnd=status%200 {"Status":{"Module":0,"FriendlyName":["nodeMCU Test"],"Topic":"DVES_ED76DA","ButtonTopic":"0","Power":0,"PowerOnState":3,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0},"StatusPRM":{"Baudrate":115200,"GroupTopic":"sonoffs","OtaUrl":"http://thehackbox.org/tasmota/release/sonoff.bin","RestartReason":"Software/System restart","Uptime":"0T00:02:15","StartupUTC":"2019-09-19T10:06:39","Sleep":50,"CfgHolder":4617,"BootCount":37,"SaveCount":60,"SaveAddress":"F9000"},"StatusFWR":{"Version":"6.6.0.12(33baadf-sonoff)","BuildDateTime":"2019-09-10T22:04:34","Boot":31,"Core":"STAGE","SDK":"2.2.2-dev(38a443e)"},"StatusLOG":{"SerialLog":2,"WebLog":4,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["FBI",""],"TelePeriod":30,"Resolution":"558180C0","SetOption":["000A8009","280500000100060000005AFF000000000000","00000200"]},"StatusMEM":{"ProgramSize":558,"Free":444,"Heap":22,"ProgramFlashSize":1024,"FlashSize":4096,"FlashChipId":"164068","FlashMode":2,"Features":["00000809","8FDAE397","003683A0","22B617CD","01001BC0","00000001"],"Drivers":"1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24","Sensors":"1,2,3,4,5,6,7,8,9,10,14,15,17,18,20,22,26,34"},"StatusNET":{"Hostname":"DVES_ED76DA-5850","IPAddress":"192.168.44.108","Gateway":"192.168.44.1","Subnetmask":"255.255.255.0","DNSServer":"192.168.44.11","Mac":"84:F3:EB:ED:76:DA","Webserver":2,"WifiConfig":4},"StatusMQT":{"MqttHost":"iot.grosskopf-tpm.de","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_ED76DA","MqttUser":"tasmota","MqttCount":1,"MAX_PACKET_SIZE":1000,"KEEPALIVE":30},"StatusTIM":{"UTC":"Thu Sep 19 10:08:54 2019","Local":"Thu Sep 19 11:08:54 2019","StartDST":"Sun Mar 31 02:00:00 2019","EndDST":"Sun Oct 27 03:00:00 2019","Timezone":"+01:00","Sunrise":"06:32","Sunset":"18:55"},"StatusSNS":{"Time":"2019-09-19T11:08:54","DS18B20-1":{"Id":"01144FC4C9AA","Temperature":20.6},"DS18B20-2":{"Id":"01144FCEEEAA","Temperature":20.6},"DS18B20-3":{"Id":"01144FD2BEAA","Temperature":20.5},"DS18B20-4":{"Id":"01144FEE20AA","Temperature":20.5},"DS18B20-5":{"Id":"01144FEFDFAA","Temperature":20.4},"TempUnit":"C"},"StatusSTS":{"Time":"2019-09-19T11:08:54","Uptime":"0T00:02:15","UptimeSec":135,"Heap":22,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":21,"MqttCount":1,"Wifi":{"AP":1,"SSId":"FBI","BSSId":"F0:B0:14:75:BF:2A","Channel":1,"RSSI":50,"LinkCount":1,"Downtime":"0T00:00:05"}}} |
Puzzling. Can't replicate here since I have just 3 DS sensors. |
Here we go... after reseting, flashing (witch 4 sensors attached) as you described I issued the following commands changed SSID and PWD, save configure other
configure Module
configure MQTT
configure Logging
console
|
result was as expected... 00:00:05 HTP: Web server active on DVES_ED76DA-5850 with IP address 192.168.44.108 |
after that I disconnected the device, wired up the fifth sensor and started again. Sadly, after that I got the same result as before.... 00:00:05 HTP: Web server active on DVES_ED76DA-5850 with IP address 192.168.44.108 |
That's sad, but at least now I know where it happens. ;) @arendst Theo, seems the script stops on line 490 of |
@qschneider |
Hi, thank your for your continuing support, here are my findings... backlog template {"NAME":"NodeMCU","GPIO":[255,255,255,255,255,255,255,255,255,255,4,255,255],"FLAG":0,"BASE":18}; Module 0; result as expected... 00:00:05 HTP: Web server active on DVES_ED76DA-5850 with IP address 192.168.44.108 |
after attaching the 5. sensor and replugging the device I got the same error message as before. 00:00:05 WIF: Connected |
Ok, I think we will talk again when I get my sensor then. Thanks for your feedback. |
ISSUE DESCRIPTION - TROUBLESHOOTING
Home Assistant mqtt auto discovery fails partially on multiple temperature sensors (DS18B20) on a nodemcu V3.
I assume that xdrv_12_home_assistant.ino does not provide that scenario yet...
manually it should look something like that, but i'am not firm enough with HA mqtt autodiscovery, so its just an assumption...
homeassistant/sensor/63D985_TEMPERATURE1/config
{"device_class": "temperature", "name": "HeizungTemperatur Raum", "state_topic": "DVES_63D985/tele/SENSOR", "unit_of_measurement": "°C", "value_template": "{{ value_json['DS18B20-1'].Temperature }}"}
homeassistant/sensor/63D985_TEMPERATURE2/config
{"device_class": "temperature", "name": "HeizungTemperatur Boiler Vorlauf", "state_topic": "DVES_63D985/tele/SENSOR", "unit_of_measurement": "°C", "value_template": "{{ value_json['DS18B20-2'].Temperature }}"}
...
This existing results on that HA device (with missing temperature entities) looks like this.
Console output here:
13:24:33 CMD: setoption19 1
13:24:33 SRC: WebConsole from 192.168.44.1
13:24:33 MQT: DVES_63D985/stat/RESULT = {"SetOption19":"ON"}
13:24:34 MQT: homeassistant/light/63D985_LI_1/config = (retained)
13:24:34 MQT: homeassistant/switch/63D985_RL_1/config = (retained)
13:24:34 MQT: homeassistant/light/63D985_LI_2/config = (retained)
13:24:34 MQT: homeassistant/switch/63D985_RL_2/config = (retained)
13:24:34 MQT: homeassistant/light/63D985_LI_3/config = (retained)
13:24:34 MQT: homeassistant/switch/63D985_RL_3/config = (retained)
13:24:34 MQT: homeassistant/light/63D985_LI_4/config = (retained)
13:24:34 MQT: homeassistant/switch/63D985_RL_4/config = (retained)
13:24:34 MQT: homeassistant/light/63D985_LI_5/config = (retained)
13:24:34 MQT: homeassistant/switch/63D985_RL_5/config = (retained)
13:24:34 MQT: homeassistant/light/63D985_LI_6/config = (retained)
13:24:34 MQT: homeassistant/switch/63D985_RL_6/config = (retained)
13:24:34 MQT: homeassistant/light/63D985_LI_7/config = (retained)
13:24:34 MQT: homeassistant/switch/63D985_RL_7/config = (retained)
13:24:34 MQT: homeassistant/light/63D985_LI_8/config = (retained)
13:24:34 MQT: homeassistant/switch/63D985_RL_8/config = (retained)
13:24:34 HASS: failed to parse 'DS18B20-1'
13:24:34 MQT: homeassistant/sensor/63D985_status/config = {"name":"HeizungTemperatur status","stat_t":"~HASS_STATE","avty_t":"~LWT","pl_avail":"Online","pl_not_avail":"Offline","json_attributes_topic":"
HASS_STATE","unit_of_meas":" ","val_tpl":"{{value_json['RSSI']}}","uniq_id":"63D985_status","device":{"identifiers":["63D985"],"connections":[["mac","CC:50:E3:63:D9:85"]],"name":"HeizungTemperatur","model":"NodeMCU V3","sw_version":"6.6.0.12(33baadf-sonoff)","manufacturer":"Tasmota"},"":"DVES_63D985/tele/"} (retained)13:24:34 CFG: Saved to flash at F4, Count 103, Bytes 4096
13:24:35 MQT: DVES_63D985/tele/HASS_STATE = {"Version":"6.6.0.12(33baadf-sonoff)","BuildDateTime":"2019-09-10T22:04:34","Core":"STAGE","SDK":"2.2.2-dev(38a443e)","Module":"NodeMCU V3","RestartReason":"Software/System restart","Uptime":"5T13:36:31","WiFi LinkCount":2,"WiFi Downtime":"0T00:00:07","MqttCount":4,"BootCount":58,"SaveCount":103,"IPAddress":"192.168.44.54","RSSI":"56","LoadAvg":27}
13:24:48 MQT: DVES_63D985/tele/STATE = {"Time":"2019-09-18T13:24:48","Uptime":"5T13:36:44","UptimeSec":481004,"Heap":24,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":4,"Wifi":{"AP":1,"SSId":"FBI","BSSId":"F0:B0:14:75:BF:2A","Channel":1,"RSSI":58,"LinkCount":2,"Downtime":"0T00:00:07"}}
13:24:48 MQT: DVES_63D985/tele/SENSOR = {"Time":"2019-09-18T13:24:48","DS18B20-1":{"Id":"000006DDD0F5","Temperature":16.6},"DS18B20-2":{"Id":"041470E982FF","Temperature":30.1},"DS18B20-3":{"Id":"041470E9DCFF","Temperature":28.6},"DS18B20-4":{"Id":"041470EA81FF","Temperature":27.8},"DS18B20-5":{"Id":"0414710F8BFF","Temperature":38.8},"DS18B20-6":{"Id":"041471600DFF","Temperature":25.2},"TempUnit":"C"}
The text was updated successfully, but these errors were encountered: