Open FearNaBoinne opened 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
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
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()
I don't believe that the existing devices are having any issues... Can you explain in more detail what you're looking for?
I am trying to lean the structure of the code to fix the boot message.
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
@BartdaMan I removed comment I notes that it was not the solution, but I think on the run it is better.
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:
Nice! will try your build.
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: