emontnemery / domoticz_mqtt_discovery

MQTT discovery plugin for Domoticz
MIT License
40 stars 28 forks source link

updateDeviceSettings: Did not find device with key='devicename', value = '9198D2_ENERGY_Total' #41

Open FearNaBoinne opened 3 years ago

FearNaBoinne commented 3 years ago

I am trying to add my first Tasmota device with power metering to the Domoticz I have running. (There's over ten other Tasmota devices, but none do power metering)

I've set it up pretty much identical to all others, with the exception of the name and template settings...

When I do 'setOption19 1', no devices get added, and instead the module logs a lot of messages like the one in the title...

Here's a section of log I see as soon as I enable homeassistant autodiscovery mode:

2021-05-01 17:08:45.052 (Mosquitto with discovery) updateDeviceSettings: Did not find device with key='devicename', value = '134AC6_status'
2021-05-01 17:08:45.052 (Mosquitto with discovery) updateDeviceSettings: TypeName: '' Type: 0
2021-05-01 17:08:45.052 (Mosquitto with discovery) onMQTTPublish: homeassistant/sensor/C287E8_status/config:b'{"name":"WiFiMulti_002 status","stat_t":"WiFiMulti_002/tele/HASS_STATE","avty_t":"WiFiMulti_002/tele/LWT","pl_avail":"Online","pl_not_avail":"Offline","json_attr_t":"WiFiMulti_002/tele/HASS_STATE","unit_of_meas":"%","val_tpl":"{{value_json[\'RSSI\']}}","ic":"mdi:information-outline","uniq_id":"C287E8_status","dev":{"ids":["C287E8"],"name":"WiFiMulti_002","mdl":"Sonoff 4CH","sw":"8.4.0(tasmota)","mf":"Tasmota"}}'
2021-05-01 17:08:45.053 (Mosquitto with discovery) updateDeviceSettings devicename: 'C287E8_status' devicetype: 'sensor' config: '{'name': 'WiFiMulti_002 status', 'state_topic': 'WiFiMulti_002/tele/HASS_STATE', 'availability_topic': 'WiFiMulti_002/tele/LWT', 'payload_available': 'Online', 'payload_not_available': 'Offline', 'json_attributes_topic': 'WiFiMulti_002/tele/HASS_STATE', 'unit_of_measurement': '%', 'value_template': "{{value_json['RSSI']}}", 'icon': 'mdi:information-outline', 'unique_id': 'C287E8_status', 'device': {'identifiers': ['C287E8'], 'name': 'WiFiMulti_002', 'model': 'Sonoff 4CH', 'sw_version': '8.4.0(tasmota)', 'manufacturer': 'Tasmota'}}'
2021-05-01 17:08:45.053 (Mosquitto with discovery) getDevices key: 'devicename' configkey: '' hasconfigkey: '' value: 'C287E8_status' config: '' topic: ''
2021-05-01 17:08:45.053 (Mosquitto with discovery) getDevices found 0 devices
2021-05-01 17:08:45.053 (Mosquitto with discovery) updateDeviceSettings: Did not find device with key='devicename', value = 'C287E8_status'
2021-05-01 17:08:45.053 (Mosquitto with discovery) updateDeviceSettings: TypeName: '' Type: 0
2021-05-01 17:08:45.053 (Mosquitto with discovery) onMQTTPublish: homeassistant/sensor/146F9C_status/config:b'{"name":"Lightbox Nen Hithoel status","stat_t":"WiFi2812_001/tele/HASS_STATE","avty_t":"WiFi2812_001/tele/LWT","pl_avail":"Online","pl_not_avail":"Offline","json_attr_t":"WiFi2812_001/tele/HASS_STATE","unit_of_meas":"%","val_tpl":"{{value_json[\'RSSI\']}}","ic":"mdi:information-outline","uniq_id":"146F9C_status","dev":{"ids":["146F9C"],"name":"Lightbox Nen Hithoel","mdl":"Generic","sw":"8.4.0(tasmota)","mf":"Tasmota"}}'
2021-05-01 17:08:45.053 (Mosquitto with discovery) updateDeviceSettings devicename: '146F9C_status' devicetype: 'sensor' config: '{'name': 'Lightbox Nen Hithoel status', 'state_topic': 'WiFi2812_001/tele/HASS_STATE', 'availability_topic': 'WiFi2812_001/tele/LWT', 'payload_available': 'Online', 'payload_not_available': 'Offline', 'json_attributes_topic': 'WiFi2812_001/tele/HASS_STATE', 'unit_of_measurement': '%', 'value_template': "{{value_json['RSSI']}}", 'icon': 'mdi:information-outline', 'unique_id': '146F9C_status', 'device': {'identifiers': ['146F9C'], 'name': 'Lightbox Nen Hithoel', 'model': 'Generic', 'sw_version': '8.4.0(tasmota)', 'manufacturer': 'Tasmota'}}'
2021-05-01 17:08:45.053 (Mosquitto with discovery) getDevices key: 'devicename' configkey: '' hasconfigkey: '' value: '146F9C_status' config: '' topic: ''
2021-05-01 17:08:45.053 (Mosquitto with discovery) getDevices found 0 devices
2021-05-01 17:08:45.053 (Mosquitto with discovery) updateDeviceSettings: Did not find device with key='devicename', value = '146F9C_status'
2021-05-01 17:08:45.053 (Mosquitto with discovery) updateDeviceSettings: TypeName: '' Type: 0
2021-05-01 17:08:45.054 (Mosquitto with discovery) onMQTTPublish: homeassistant/sensor/D66E1D_status/config:b'{"name":"RGB Tuinspot status","stat_t":"tasmota_D66E1D/tele/HASS_STATE","avty_t":"tasmota_D66E1D/tele/LWT","pl_avail":"Online","pl_not_avail":"Offline","json_attr_t":"tasmota_D66E1D/tele/HASS_STATE","unit_of_meas":"%","val_tpl":"{{value_json[\'RSSI\']}}","ic":"mdi:information-outline","uniq_id":"D66E1D_status","dev":{"ids":["D66E1D"],"name":"RGB Tuinspot","mdl":"Tuya GU10 RGB","sw":"8.5.1(tasmota)","mf":"Tasmota"}}'
2021-05-01 17:08:45.054 (Mosquitto with discovery) updateDeviceSettings devicename: 'D66E1D_status' devicetype: 'sensor' config: '{'name': 'RGB Tuinspot status', 'state_topic': 'tasmota_D66E1D/tele/HASS_STATE', 'availability_topic': 'tasmota_D66E1D/tele/LWT', 'payload_available': 'Online', 'payload_not_available': 'Offline', 'json_attributes_topic': 'tasmota_D66E1D/tele/HASS_STATE', 'unit_of_measurement': '%', 'value_template': "{{value_json['RSSI']}}", 'icon': 'mdi:information-outline', 'unique_id': 'D66E1D_status', 'device': {'identifiers': ['D66E1D'], 'name': 'RGB Tuinspot', 'model': 'Tuya GU10 RGB', 'sw_version': '8.5.1(tasmota)', 'manufacturer': 'Tasmota'}}'
2021-05-01 17:08:45.054 (Mosquitto with discovery) getDevices key: 'devicename' configkey: '' hasconfigkey: '' value: 'D66E1D_status' config: '' topic: ''
2021-05-01 17:08:45.054 (Mosquitto with discovery) getDevices found 0 devices
2021-05-01 17:08:45.054 (Mosquitto with discovery) updateDeviceSettings: Did not find device with key='devicename', value = 'D66E1D_status'
2021-05-01 17:08:45.054 (Mosquitto with discovery) updateDeviceSettings: TypeName: '' Type: 0
2021-05-01 17:08:45.054 (Mosquitto with discovery) onMQTTPublish: homeassistant/sensor/6B6A48_status/config:b'{"name":"Patiobulb_003 status","stat_t":"~HASS_STATE","avty_t":"~LWT","frc_upd":true,"pl_avail":"Online","pl_not_avail":"Offline","json_attributes_topic":"~HASS_STATE","unit_of_meas":" ","val_tpl":"{{value_json[\'RSSI\']}}","ic":"mdi:information-outline","uniq_id":"6B6A48_status","device":{"identifiers":["6B6A48"],"connections":[["mac","84:0D:8E:6B:6A:48"]],"name":"Patiobulb_003","model":"LSC Filam E14","sw_version":"8.1.0.2(tasmota)","manufacturer":"Tasmota"},"~":"Patiobulb_003/tele/"}'
2021-05-01 17:08:45.054 (Mosquitto with discovery) updateDeviceSettings devicename: '6B6A48_status' devicetype: 'sensor' config: '{'name': 'Patiobulb_003 status', 'state_topic': 'Patiobulb_003/tele/HASS_STATE', 'availability_topic': 'Patiobulb_003/tele/LWT', 'force_update': True, 'payload_available': 'Online', 'payload_not_available': 'Offline', 'json_attributes_topic': 'Patiobulb_003/tele/HASS_STATE', 'unit_of_measurement': ' ', 'value_template': "{{value_json['RSSI']}}", 'icon': 'mdi:information-outline', 'unique_id': '6B6A48_status', 'device': {'identifiers': ['6B6A48'], 'connections': [['mac', '84:0D:8E:6B:6A:48']], 'name': 'Patiobulb_003', 'model': 'LSC Filam E14', 'sw_version': '8.1.0.2(tasmota)', 'manufacturer': 'Tasmota'}}'
2021-05-01 17:08:45.054 (Mosquitto with discovery) getDevices key: 'devicename' configkey: '' hasconfigkey: '' value: '6B6A48_status' config: '' topic: ''
2021-05-01 17:08:45.055 (Mosquitto with discovery) getDevices found 0 devices
2021-05-01 17:08:45.055 (Mosquitto with discovery) updateDeviceSettings: Did not find device with key='devicename', value = '6B6A48_status'
2021-05-01 17:08:45.055 (Mosquitto with discovery) updateDeviceSettings: TypeName: '' Type: 0
2021-05-01 17:08:45.055 (Mosquitto with discovery) onMQTTPublish: homeassistant/sensor/9198D2_ENERGY_TotalStartTime/config:b'{"name":"Compressor ENERGY TotalStartTime","stat_t":"Compressor/tele/SENSOR","avty_t":"Compressor/tele/LWT","pl_avail":"Online","pl_not_avail":"Offline","uniq_id":"9198D2_ENERGY_TotalStartTime","dev":{"ids":["9198D2"]},"unit_of_meas":" ","ic":"mdi:progress-clock","frc_upd":true,"val_tpl":"{{value_json[\'ENERGY\'][\'TotalStartTime\']}}"}'
2021-05-01 17:08:45.055 (Mosquitto with discovery) updateDeviceSettings devicename: '9198D2_ENERGY_TotalStartTime' devicetype: 'sensor' config: '{'name': 'Compressor ENERGY TotalStartTime', 'state_topic': 'Compressor/tele/SENSOR', 'availability_topic': 'Compressor/tele/LWT', 'payload_available': 'Online', 'payload_not_available': 'Offline', 'unique_id': '9198D2_ENERGY_TotalStartTime', 'device': {'identifiers': ['9198D2']}, 'unit_of_measurement': ' ', 'icon': 'mdi:progress-clock', 'force_update': True, 'value_template': "{{value_json['ENERGY']['TotalStartTime']}}"}'
2021-05-01 17:08:45.055 (Mosquitto with discovery) getDevices key: 'devicename' configkey: '' hasconfigkey: '' value: '9198D2_ENERGY_TotalStartTime' config: '' topic: ''
2021-05-01 17:08:45.055 (Mosquitto with discovery) getDevices found 0 devices
2021-05-01 17:08:45.055 (Mosquitto with discovery) updateDeviceSettings: Did not find device with key='devicename', value = '9198D2_ENERGY_TotalStartTime'
2021-05-01 17:08:45.055 (Mosquitto with discovery) updateDeviceSettings: TypeName: '' Type: 0
2021-05-01 17:08:45.055 (Mosquitto with discovery) onMQTTPublish: homeassistant/sensor/9198D2_ENERGY_Total/config:b'{"name":"Compressor ENERGY Total","stat_t":"Compressor/tele/SENSOR","avty_t":"Compressor/tele/LWT","pl_avail":"Online","pl_not_avail":"Offline","uniq_id":"9198D2_ENERGY_Total","dev":{"ids":["9198D2"]},"unit_of_meas":"kWh","dev_cla":"power","frc_upd":true,"val_tpl":"{{value_json[\'ENERGY\'][\'Total\']}}"}'
2021-05-01 17:08:45.055 (Mosquitto with discovery) updateDeviceSettings devicename: '9198D2_ENERGY_Total' devicetype: 'sensor' config: '{'name': 'Compressor ENERGY Total', 'state_topic': 'Compressor/tele/SENSOR', 'availability_topic': 'Compressor/tele/LWT', 'payload_available': 'Online', 'payload_not_available': 'Offline', 'unique_id': '9198D2_ENERGY_Total', 'device': {'identifiers': ['9198D2']}, 'unit_of_measurement': 'kWh', 'device_class': 'power', 'force_update': True, 'value_template': "{{value_json['ENERGY']['Total']}}"}'
2021-05-01 17:08:45.056 (Mosquitto with discovery) getDevices key: 'devicename' configkey: '' hasconfigkey: '' value: '9198D2_ENERGY_Total' config: '' topic: ''
2021-05-01 17:08:45.056 (Mosquitto with discovery) getDevices found 0 devices
2021-05-01 17:08:45.056 (Mosquitto with discovery) updateDeviceSettings: Did not find device with key='devicename', value = '9198D2_ENERGY_Total'
2021-05-01 17:08:45.056 (Mosquitto with discovery) updateDeviceSettings: TypeName: '' Type: 0
2021-05-01 17:08:45.056 (Mosquitto with discovery) onMQTTPublish: homeassistant/sensor/9198D2_ENERGY_Yesterday/config:b'{"name":"Compressor ENERGY Yesterday","stat_t":"Compressor/tele/SENSOR","avty_t":"Compressor/tele/LWT","pl_avail":"Online","pl_not_avail":"Offline","uniq_id":"9198D2_ENERGY_Yesterday","dev":{"ids":["9198D2"]},"unit_of_meas":"kWh","dev_cla":"power","frc_upd":true,"val_tpl":"{{value_json[\'ENERGY\'][\'Yesterday\']}}"}'
2021-05-01 17:08:45.056 (Mosquitto with discovery) updateDeviceSettings devicename: '9198D2_ENERGY_Yesterday' devicetype: 'sensor' config: '{'name': 'Compressor ENERGY Yesterday', 'state_topic': 'Compressor/tele/SENSOR', 'availability_topic': 'Compressor/tele/LWT', 'payload_available': 'Online', 'payload_not_available': 'Offline', 'unique_id': '9198D2_ENERGY_Yesterday', 'device': {'identifiers': ['9198D2']}, 'unit_of_measurement': 'kWh', 'device_class': 'power', 'force_update': True, 'value_template': "{{value_json['ENERGY']['Yesterday']}}"}'
2021-05-01 17:08:45.056 (Mosquitto with discovery) getDevices key: 'devicename' configkey: '' hasconfigkey: '' value: '9198D2_ENERGY_Yesterday' config: '' topic: ''
2021-05-01 17:08:45.056 (Mosquitto with discovery) getDevices found 0 devices
2021-05-01 17:08:45.056 (Mosquitto with discovery) updateDeviceSettings: Did not find device with key='devicename', value = '9198D2_ENERGY_Yesterday'
2021-05-01 17:08:45.056 (Mosquitto with discovery) updateDeviceSettings: TypeName: '' Type: 0
2021-05-01 17:08:45.056 (Mosquitto with discovery) onMQTTPublish: homeassistant/sensor/9198D2_ENERGY_Today/config:b'{"name":"Compressor ENERGY Today","stat_t":"Compressor/tele/SENSOR","avty_t":"Compressor/tele/LWT","pl_avail":"Online","pl_not_avail":"Offline","uniq_id":"9198D2_ENERGY_Today","dev":{"ids":["9198D2"]},"unit_of_meas":"kWh","dev_cla":"power","frc_upd":true,"val_tpl":"{{value_json[\'ENERGY\'][\'Today\']}}"}'
2021-05-01 17:08:45.057 (Mosquitto with discovery) updateDeviceSettings devicename: '9198D2_ENERGY_Today' devicetype: 'sensor' config: '{'name': 'Compressor ENERGY Today', 'state_topic': 'Compressor/tele/SENSOR', 'availability_topic': 'Compressor/tele/LWT', 'payload_available': 'Online', 'payload_not_available': 'Offline', 'unique_id': '9198D2_ENERGY_Today', 'device': {'identifiers': ['9198D2']}, 'unit_of_measurement': 'kWh', 'device_class': 'power', 'force_update': True, 'value_template': "{{value_json['ENERGY']['Today']}}"}'
2021-05-01 17:08:45.057 (Mosquitto with discovery) getDevices key: 'devicename' configkey: '' hasconfigkey: '' value: '9198D2_ENERGY_Today' config: '' topic: ''
2021-05-01 17:08:45.057 (Mosquitto with discovery) getDevices found 0 devices
2021-05-01 17:08:45.057 (Mosquitto with discovery) updateDeviceSettings: Did not find device with key='devicename', value = '9198D2_ENERGY_Today'
2021-05-01 17:08:45.057 (Mosquitto with discovery) updateDeviceSettings: TypeName: '' Type: 0
2021-05-01 17:08:45.057 (Mosquitto with discovery) onMQTTPublish: homeassistant/sensor/9198D2_ENERGY_Power/config:b'{"name":"Compressor ENERGY Power","stat_t":"Compressor/tele/SENSOR","avty_t":"Compressor/tele/LWT","pl_avail":"Online","pl_not_avail":"Offline","uniq_id":"9198D2_ENERGY_Power","dev":{"ids":["9198D2"]},"unit_of_meas":"W","dev_cla":"power","frc_upd":true,"val_tpl":"{{value_json[\'ENERGY\'][\'Power\']}}"}'
2021-05-01 17:08:45.057 (Mosquitto with discovery) updateDeviceSettings devicename: '9198D2_ENERGY_Power' devicetype: 'sensor' config: '{'name': 'Compressor ENERGY Power', 'state_topic': 'Compressor/tele/SENSOR', 'availability_topic': 'Compressor/tele/LWT', 'payload_available': 'Online', 'payload_not_available': 'Offline', 'unique_id': '9198D2_ENERGY_Power', 'device': {'identifiers': ['9198D2']}, 'unit_of_measurement': 'W', 'device_class': 'power', 'force_update': True, 'value_template': "{{value_json['ENERGY']['Power']}}"}'
2021-05-01 17:08:45.057 (Mosquitto with discovery) getDevices key: 'devicename' configkey: '' hasconfigkey: '' value: '9198D2_ENERGY_Power' config: '' topic: ''
2021-05-01 17:08:45.057 (Mosquitto with discovery) getDevices found 0 devices
2021-05-01 17:08:45.057 (Mosquitto with discovery) updateDeviceSettings: Did not find device with key='devicename', value = '9198D2_ENERGY_Power'
2021-05-01 17:08:45.057 (Mosquitto with discovery) updateDeviceSettings: TypeName: '' Type: 0
2021-05-01 17:08:45.057 (Mosquitto with discovery) onMQTTPublish: homeassistant/sensor/9198D2_ENERGY_ApparentPower/config:b'{"name":"Compressor ENERGY ApparentPower","stat_t":"Compressor/tele/SENSOR","avty_t":"Compressor/tele/LWT","pl_avail":"Online","pl_not_avail":"Offline","uniq_id":"9198D2_ENERGY_ApparentPower","dev":{"ids":["9198D2"]},"unit_of_meas":"VA","dev_cla":"power","frc_upd":true,"val_tpl":"{{value_json[\'ENERGY\'][\'ApparentPower\']}}"}'
2021-05-01 17:08:45.058 (Mosquitto with discovery) updateDeviceSettings devicename: '9198D2_ENERGY_ApparentPower' devicetype: 'sensor' config: '{'name': 'Compressor ENERGY ApparentPower', 'state_topic': 'Compressor/tele/SENSOR', 'availability_topic': 'Compressor/tele/LWT', 'payload_available': 'Online', 'payload_not_available': 'Offline', 'unique_id': '9198D2_ENERGY_ApparentPower', 'device': {'identifiers': ['9198D2']}, 'unit_of_measurement': 'VA', 'device_class': 'power', 'force_update': True, 'value_template': "{{value_json['ENERGY']['ApparentPower']}}"}'
2021-05-01 17:08:45.058 (Mosquitto with discovery) getDevices key: 'devicename' configkey: '' hasconfigkey: '' value: '9198D2_ENERGY_ApparentPower' config: '' topic: ''
2021-05-01 17:08:45.058 (Mosquitto with discovery) getDevices found 0 devices
2021-05-01 17:08:45.058 (Mosquitto with discovery) updateDeviceSettings: Did not find device with key='devicename', value = '9198D2_ENERGY_ApparentPower'
2021-05-01 17:08:45.058 (Mosquitto with discovery) updateDeviceSettings: TypeName: '' Type: 0
2021-05-01 17:08:45.058 (Mosquitto with discovery) onMQTTPublish: homeassistant/sensor/9198D2_ENERGY_ReactivePower/config:b'{"name":"Compressor ENERGY ReactivePower","stat_t":"Compressor/tele/SENSOR","avty_t":"Compressor/tele/LWT","pl_avail":"Online","pl_not_avail":"Offline","uniq_id":"9198D2_ENERGY_ReactivePower","dev":{"ids":["9198D2"]},"unit_of_meas":"VAr","dev_cla":"power","frc_upd":true,"val_tpl":"{{value_json[\'ENERGY\'][\'ReactivePower\']}}"}'
2021-05-01 17:08:45.058 (Mosquitto with discovery) updateDeviceSettings devicename: '9198D2_ENERGY_ReactivePower' devicetype: 'sensor' config: '{'name': 'Compressor ENERGY ReactivePower', 'state_topic': 'Compressor/tele/SENSOR', 'availability_topic': 'Compressor/tele/LWT', 'payload_available': 'Online', 'payload_not_available': 'Offline', 'unique_id': '9198D2_ENERGY_ReactivePower', 'device': {'identifiers': ['9198D2']}, 'unit_of_measurement': 'VAr', 'device_class': 'power', 'force_update': True, 'value_template': "{{value_json['ENERGY']['ReactivePower']}}"}'
2021-05-01 17:08:45.058 (Mosquitto with discovery) getDevices key: 'devicename' configkey: '' hasconfigkey: '' value: '9198D2_ENERGY_ReactivePower' config: '' topic: ''
2021-05-01 17:08:45.058 (Mosquitto with discovery) getDevices found 0 devices
2021-05-01 17:08:45.058 (Mosquitto with discovery) updateDeviceSettings: Did not find device with key='devicename', value = '9198D2_ENERGY_ReactivePower'
2021-05-01 17:08:45.058 (Mosquitto with discovery) updateDeviceSettings: TypeName: '' Type: 0
2021-05-01 17:08:45.059 (Mosquitto with discovery) onMQTTPublish: homeassistant/sensor/9198D2_ENERGY_Factor/config:b'{"name":"Compressor ENERGY Factor","stat_t":"Compressor/tele/SENSOR","avty_t":"Compressor/tele/LWT","pl_avail":"Online","pl_not_avail":"Offline","uniq_id":"9198D2_ENERGY_Factor","dev":{"ids":["9198D2"]},"unit_of_meas":"Cos \\u03c6","ic":"mdi:alpha-f-circle-outline","frc_upd":true,"val_tpl":"{{value_json[\'ENERGY\'][\'Factor\']}}"}'
2021-05-01 17:08:45.059 (Mosquitto with discovery) updateDeviceSettings devicename: '9198D2_ENERGY_Factor' devicetype: 'sensor' config: '{'name': 'Compressor ENERGY Factor', 'state_topic': 'Compressor/tele/SENSOR', 'availability_topic': 'Compressor/tele/LWT', 'payload_available': 'Online', 'payload_not_available': 'Offline', 'unique_id': '9198D2_ENERGY_Factor', 'device': {'identifiers': ['9198D2']}, 'unit_of_measurement': 'Cos φ', 'icon': 'mdi:alpha-f-circle-outline', 'force_update': True, 'value_template': "{{value_json['ENERGY']['Factor']}}"}'
2021-05-01 17:08:45.059 (Mosquitto with discovery) getDevices key: 'devicename' configkey: '' hasconfigkey: '' value: '9198D2_ENERGY_Factor' config: '' topic: ''
2021-05-01 17:08:45.059 (Mosquitto with discovery) getDevices found 0 devices
2021-05-01 17:08:45.059 (Mosquitto with discovery) updateDeviceSettings: Did not find device with key='devicename', value = '9198D2_ENERGY_Factor'
2021-05-01 17:08:45.059 (Mosquitto with discovery) updateDeviceSettings: TypeName: '' Type: 0
2021-05-01 17:08:45.059 (Mosquitto with discovery) onMQTTPublish: homeassistant/sensor/9198D2_ENERGY_Voltage/config:b'{"name":"Compressor ENERGY Voltage","stat_t":"Compressor/tele/SENSOR","avty_t":"Compressor/tele/LWT","pl_avail":"Online","pl_not_avail":"Offline","uniq_id":"9198D2_ENERGY_Voltage","dev":{"ids":["9198D2"]},"unit_of_meas":"V","ic":"mdi:alpha-v-circle-outline","frc_upd":true,"val_tpl":"{{value_json[\'ENERGY\'][\'Voltage\']}}"}'
2021-05-01 17:08:45.059 (Mosquitto with discovery) updateDeviceSettings devicename: '9198D2_ENERGY_Voltage' devicetype: 'sensor' config: '{'name': 'Compressor ENERGY Voltage', 'state_topic': 'Compressor/tele/SENSOR', 'availability_topic': 'Compressor/tele/LWT', 'payload_available': 'Online', 'payload_not_available': 'Offline', 'unique_id': '9198D2_ENERGY_Voltage', 'device': {'identifiers': ['9198D2']}, 'unit_of_measurement': 'V', 'icon': 'mdi:alpha-v-circle-outline', 'force_update': True, 'value_template': "{{value_json['ENERGY']['Voltage']}}"}'
2021-05-01 17:08:45.059 (Mosquitto with discovery) getDevices key: 'devicename' configkey: '' hasconfigkey: '' value: '9198D2_ENERGY_Voltage' config: '' topic: ''
2021-05-01 17:08:45.059 (Mosquitto with discovery) getDevices found 0 devices
2021-05-01 17:08:45.059 (Mosquitto with discovery) updateDeviceSettings: Did not find device with key='devicename', value = '9198D2_ENERGY_Voltage'
2021-05-01 17:08:45.059 (Mosquitto with discovery) updateDeviceSettings: TypeName: '' Type: 0
2021-05-01 17:08:45.060 (Mosquitto with discovery) onMQTTPublish: homeassistant/sensor/9198D2_ENERGY_Current/config:b'{"name":"Compressor ENERGY Current","stat_t":"Compressor/tele/SENSOR","avty_t":"Compressor/tele/LWT","pl_avail":"Online","pl_not_avail":"Offline","uniq_id":"9198D2_ENERGY_Current","dev":{"ids":["9198D2"]},"unit_of_meas":"A","ic":"mdi:alpha-a-circle-outline","frc_upd":true,"val_tpl":"{{value_json[\'ENERGY\'][\'Current\']}}"}'
2021-05-01 17:08:45.060 (Mosquitto with discovery) updateDeviceSettings devicename: '9198D2_ENERGY_Current' devicetype: 'sensor' config: '{'name': 'Compressor ENERGY Current', 'state_topic': 'Compressor/tele/SENSOR', 'availability_topic': 'Compressor/tele/LWT', 'payload_available': 'Online', 'payload_not_available': 'Offline', 'unique_id': '9198D2_ENERGY_Current', 'device': {'identifiers': ['9198D2']}, 'unit_of_measurement': 'A', 'icon': 'mdi:alpha-a-circle-outline', 'force_update': True, 'value_template': "{{value_json['ENERGY']['Current']}}"}'
2021-05-01 17:08:45.060 (Mosquitto with discovery) getDevices key: 'devicename' configkey: '' hasconfigkey: '' value: '9198D2_ENERGY_Current' config: '' topic: ''
2021-05-01 17:08:45.060 (Mosquitto with discovery) getDevices found 0 devices
2021-05-01 17:08:45.060 (Mosquitto with discovery) updateDeviceSettings: Did not find device with key='devicename', value = '9198D2_ENERGY_Current'
2021-05-01 17:08:45.060 (Mosquitto with discovery) updateDeviceSettings: TypeName: '' Type: 0
2021-05-01 17:08:45.060 (Mosquitto with discovery) onMQTTPublish: homeassistant/sensor/9198D2_status/config:b'{"name":"Compressor status","stat_t":"Compressor/tele/HASS_STATE","avty_t":"Compressor/tele/LWT","pl_avail":"Online","pl_not_avail":"Offline","json_attr_t":"Compressor/tele/HASS_STATE","unit_of_meas":"%","val_tpl":"{{value_json[\'RSSI\']}}","ic":"mdi:information-outline","uniq_id":"9198D2_status","dev":{"ids":["9198D2"],"name":"Compressor","mdl":"Gosund SP1 v23","sw":"9.3.1.3(tasmota)","mf":"Tasmota"}}'
2021-05-01 17:08:45.060 (Mosquitto with discovery) updateDeviceSettings devicename: '9198D2_status' devicetype: 'sensor' config: '{'name': 'Compressor status', 'state_topic': 'Compressor/tele/HASS_STATE', 'availability_topic': 'Compressor/tele/LWT', 'payload_available': 'Online', 'payload_not_available': 'Offline', 'json_attributes_topic': 'Compressor/tele/HASS_STATE', 'unit_of_measurement': '%', 'value_template': "{{value_json['RSSI']}}", 'icon': 'mdi:information-outline', 'unique_id': '9198D2_status', 'device': {'identifiers': ['9198D2'], 'name': 'Compressor', 'model': 'Gosund SP1 v23', 'sw_version': '9.3.1.3(tasmota)', 'manufacturer': 'Tasmota'}}'
2021-05-01 17:08:45.060 (Mosquitto with discovery) getDevices key: 'devicename' configkey: '' hasconfigkey: '' value: '9198D2_status' config: '' topic: ''
2021-05-01 17:08:45.061 (Mosquitto with discovery) getDevices found 0 devices
2021-05-01 17:08:45.061 (Mosquitto with discovery) updateDeviceSettings: Did not find device with key='devicename', value = '9198D2_status'
2021-05-01 17:08:45.061 (Mosquitto with discovery) updateDeviceSettings: TypeName: '' Type: 0
Xenomes commented 3 years ago

I also have these messages on start-up and these also:

2021-05-02 22:13:07.504 Error: MQTT Discovery Tasmota: (MQTT Discovery Tasmota) Transport is not connected, write directive to '192.168.1.*' ignored.
2021-05-02 22:13:07.504 Error: MQTT Discovery Tasmota: (MQTT Discovery Tasmota) Transport is not connected, write directive to '192.168.1.*' ignored.
2021-05-02 22:13:09.697 Error: MQTT Discovery Tasmota: (MQTT Discovery Tasmota) Transport is not connected, write directive to '192.168.1.*' ignored.
2021-05-02 22:13:09.751 Error: (MQTT Discovery Tasmota): Async Read Exception (192.168.1.*:1883): 104, Connection reset by peer
2021-05-02 22:13:10.164 Error: handleWrite: Exception thrown: 'write: Broken pipe'
2021-05-02 22:13:10.164 Error: handleWrite: Exception thrown: 'write: Broken pipe'
2021-05-02 22:13:10.164 Error: handleWrite: Exception thrown: 'write: Broken pipe'
2021-05-02 22:13:10.164 Error: handleWrite: Exception thrown: 'write: Broken pipe'
2021-05-02 22:13:10.164 Error: handleWrite: Exception thrown: 'write: Broken pipe'
2021-05-02 22:13:10.215 Error: (MQTT Discovery Tasmota): Socket Shutdown Error: 107, Transport endpoint is not connected
2021-05-02 22:13:13.857 Error: (MQTT Discovery Tasmota): Async Read Exception (192.168.1.*:1883): 104, Connection reset by peer
2021-05-02 22:13:13.901 Error: handleWrite: Exception thrown: 'write: Broken pipe'
2021-05-02 22:13:13.901 Error: handleWrite: Exception thrown: 'write: Broken pipe'
2021-05-02 22:13:13.901 Error: handleWrite: Exception thrown: 'write: Broken pipe'
2021-05-02 22:13:13.901 Error: handleWrite: Exception thrown: 'write: Broken pipe'
2021-05-02 22:13:13.902 Error: MQTT Discovery Tasmota: (MQTT Discovery Tasmota) No transport, write directive to '192.168.1.*' ignored.
2021-05-02 22:13:13.905 Error: MQTT Discovery Tasmota: (MQTT Discovery Tasmota) No transport, write directive to '192.168.1.*' ignored. 

Running Domoticz 2021.1 plug-in version 0.0.4

BartdaMan commented 3 years ago

I think I'm seeing the same issue with Tasmota Sensors 9.4.0.4 running on a D1 mini in combination with a BH1750 lux sensor.

2021-06-02 10:12:34.074 MQTT discovery: (MQTT discovery) Heartbeating... 2021-06-02 10:12:34.074 MQTT discovery: (MQTT discovery) MqttClient::Ping 2021-06-02 10:12:37.654 MQTT discovery: (MQTT discovery) updateDeviceSettings devicename: '657FE7_BH1750_Illuminance' devicetype: 'sensor' config: '{'name': 'Tasmota BH1750 Illuminance', 'state_topic': 'tele/tasmota_657FE7/SENSOR', 'availability_topic': 'tele/tasmota_657FE7/LWT', 'payload_available': 'Online', 'payload_not_available': 'Offline', 'unique_id': '657FE7_BH1750_Illuminance', 'device': {'identifiers': ['657FE7']}, 'unit_of_measurement': 'lux', 'device_class': 'illuminance', 'force_update': True, 'value_template': "{{value_json['BH1750']['Illuminance']}}"}' 2021-06-02 10:12:37.654 MQTT discovery: (MQTT discovery) getDevices key: 'devicename' configkey: '' hasconfigkey: '' value: '657FE7_BH1750_Illuminance' config: '' topic: '' 2021-06-02 10:12:37.654 MQTT discovery: (MQTT discovery) getDevices found 0 devices 2021-06-02 10:12:37.654 MQTT discovery: (MQTT discovery) updateDeviceSettings: Did not find device with key='devicename', value = '657FE7_BH1750_Illuminance' 2021-06-02 10:12:37.655 MQTT discovery: (MQTT discovery) updateDeviceSettings: TypeName: '' Type: 0 2021-06-02 10:12:37.662 MQTT discovery: (MQTT discovery) updateDeviceSettings devicename: '657FE7_status' devicetype: 'sensor' config: '{'name': 'Tasmota status', 'state_topic': 'tele/tasmota_657FE7/HASS_STATE', 'availability_topic': 'tele/tasmota_657FE7/LWT', 'payload_available': 'Online', 'payload_not_available': 'Offline', 'json_attributes_topic': 'tele/tasmota_657FE7/HASS_STATE', 'unit_of_measurement': '%', 'value_template': "{{value_json['RSSI']}}", 'icon': 'mdi:information-outline', 'unique_id': '657FE7_status', 'device': {'identifiers': ['657FE7'], 'name': 'Tasmota', 'model': 'Generic', 'sw_version': '9.4.0.4(sensors)', 'manufacturer': 'Tasmota'}}' 2021-06-02 10:12:37.663 MQTT discovery: (MQTT discovery) getDevices key: 'devicename' configkey: '' hasconfigkey: '' value: '657FE7_status' config: '' topic: '' 2021-06-02 10:12:37.663 MQTT discovery: (MQTT discovery) getDevices found 0 devices 2021-06-02 10:12:37.663 MQTT discovery: (MQTT discovery) updateDeviceSettings: Did not find device with key='devicename', value = '657FE7_status' 2021-06-02 10:12:37.663 MQTT discovery: (MQTT discovery) updateDeviceSettings: TypeName: '' Type: 0 2021-06-02 10:12:44.076 MQTT discovery: (MQTT discovery) Heartbeating... 2021-06-02 10:12:44.076 MQTT discovery: (MQTT discovery) MqttClient::Ping 2021-06-02 10:12:54.095 MQTT discovery: (MQTT discovery) Heartbeating... 2021-06-02 10:12:54.096 MQTT discovery: (MQTT discovery) MqttClient::Ping

Xenomes commented 3 years ago

I think it has to do with something a change in Domoticz 2021.1, I am currently trying to find a fix for the problem. The error exist in this part of the code. Does anyone experience the issue that a Tasmota device is flipping very quick on and off when it was trigger a on, off, on to quickly?

        matchingDevices = self.getDevices(key='devicename', value=devicename)
        if len(matchingDevices) == 0:
            Domoticz.Log("updateDeviceSettings: Did not find device with key='devicename', value = '" +  devicename + "'")
            # Unknown device
            Domoticz.Log("updateDeviceSettings: TypeName: '" + TypeName + "' Type: " + str(Type))
            if TypeName != '':
                self.addTasmotaTopics(config)
                if not self.isDeviceIgnored(config):
                    self.makeDevice(devicename, TypeName, switchTypeDomoticz, config)
                    # Update subscription list
                    self.mqttClient.Subscribe(self.getTopics())
            elif Type != 0:
                self.addTasmotaTopics(config)
                if not self.isDeviceIgnored(config):
                    self.makeDeviceRaw(devicename, Type, Subtype, switchTypeDomoticz, config)
                    # Update subscription list
                    self.mqttClient.Subscribe(self.getTopics())
        else:
            # TODO: What do if len(matchingDevices) > 1?
            device = matchingDevices[0]
            self.addTasmotaTopics(config)
            oldconfigdict = {}
            try:
                oldconfigdict = json.loads(device.Options['config'])
            except (ValueError, KeyError, TypeError) as e:
                pass
            if Type != 0 and (device.Type != Type or device.SubType != Subtype or device.SwitchType != switchTypeDomoticz or oldconfigdict != config):
                Domoticz.Log("updateDeviceSettings: " + self.deviceStr(self.getUnit(device)) + ": Device settings not matching, updating Type, SubType, Switchtype and Options['config']")
                Domoticz.Log("updateDeviceSettings: device.Type: " + str(device.Type) + "->" + str(Type) + ", device.SubType: " + str(device.SubType) + "->" + str(Subtype) +
                             ", device.SwitchType: " + str(device.SwitchType) + "->" + str(switchTypeDomoticz) +
                             ", device.Options['config']: " + str(oldconfigdict) + " -> " + str(config))
                nValue = device.nValue
                sValue = device.sValue
                Options = dict(device.Options)
                Options['config'] = json.dumps(config)
                device.Update(nValue=nValue, sValue=sValue, Type=Type, Subtype=Subtype, Switchtype=switchTypeDomoticz, Options=Options, SuppressTriggers=True)
                self.copyDevices()
FearNaBoinne commented 3 years ago

I don't believe that the existing devices are having any issues... Can you explain in more detail what you're looking for?

Xenomes commented 3 years ago

I am trying to lean the structure of the code to fix the boot message.

BartdaMan commented 3 years ago

Hello,

I just downgraded to the version as per your link. I still get these errors:

2021-06-07 11:38:01.072 MQTT discovery: (MQTT discovery) MqttClient::Ping 2021-06-07 11:38:11.091 MQTT discovery: (MQTT discovery) Heartbeating... 2021-06-07 11:38:11.091 MQTT discovery: (MQTT discovery) MqttClient::Ping 2021-06-07 11:38:12.005 MQTT discovery: (MQTT discovery) updateDeviceSettings devicename: '657FE7_BH1750_Illuminance' devicetype: 'sensor' config: '{'name': 'Tasmota BH1750 Illuminance', 'state_topic': 'tele/tasmota_657FE7/SENSOR', 'availability_topic': 'tele/tasmota_657FE7/LWT', 'payload_available': 'Online', 'payload_not_available': 'Offline', 'unique_id': '657FE7_BH1750_Illuminance', 'device': {'identifiers': ['657FE7']}, 'unit_of_measurement': 'lux', 'device_class': 'illuminance', 'force_update': True, 'value_template': "{{value_json['BH1750']['Illuminance']}}"}' 2021-06-07 11:38:12.006 MQTT discovery: (MQTT discovery) getDevices key: 'devicename' configkey: '' hasconfigkey: '' value: '657FE7_BH1750_Illuminance' config: '' topic: '' 2021-06-07 11:38:12.014 MQTT discovery: (MQTT discovery) getDevices found 0 devices 2021-06-07 11:38:12.015 MQTT discovery: (MQTT discovery) updateDeviceSettings: Did not find device with key='devicename', value = '657FE7_BH1750_Illuminance' 2021-06-07 11:38:12.015 MQTT discovery: (MQTT discovery) updateDeviceSettings: TypeName: '' Type: 0 2021-06-07 11:38:12.123 MQTT discovery: (MQTT discovery) updateDeviceSettings devicename: '657FE7_status' devicetype: 'sensor' config: '{'name': 'Tasmota status', 'state_topic': 'tele/tasmota_657FE7/HASS_STATE', 'availability_topic': 'tele/tasmota_657FE7/LWT', 'payload_available': 'Online', 'payload_not_available': 'Offline', 'json_attributes_topic': 'tele/tasmota_657FE7/HASS_STATE', 'unit_of_measurement': '%', 'value_template': "{{value_json['RSSI']}}", 'icon': 'mdi:information-outline', 'unique_id': '657FE7_status', 'device': {'identifiers': ['657FE7'], 'name': 'Tasmota', 'model': 'Generic', 'sw_version': '9.4.0.4(sensors)', 'manufacturer': 'Tasmota'}}' 2021-06-07 11:38:12.124 MQTT discovery: (MQTT discovery) getDevices key: 'devicename' configkey: '' hasconfigkey: '' value: '657FE7_status' config: '' topic: '' 2021-06-07 11:38:12.125 MQTT discovery: (MQTT discovery) getDevices found 0 devices 2021-06-07 11:38:12.126 MQTT discovery: (MQTT discovery) updateDeviceSettings: Did not find device with key='devicename', value = '657FE7_status' 2021-06-07 11:38:12.128 MQTT discovery: (MQTT discovery) updateDeviceSettings: TypeName: '' Type: 0 2021-06-07 11:38:21.094 MQTT discovery: (MQTT discovery) Heartbeating... 2021-06-07 11:38:21.094 MQTT discovery: (MQTT discovery) MqttClient::Ping

My Domoticz version is: Version: 2021.1 (build 13256) Build Hash: ab915f0a4

Any ideas how to solve this?

Best regards,

Bart

Xenomes commented 3 years ago

@BartdaMan I removed comment I notes that it was not the solution, but I think on the run it is better.

altserg commented 2 years ago

You can have a look at my latest pull request that adds basic Temperature and Humidity sensor support. Note that if you have only one sensor, you can configure it in Domoticz menu of Tasmota

Example configuration for SmartSocket: image

Xenomes commented 2 years ago

Nice! will try your build.