NorthernMan54 / homebridge-tasmota

Plugin for Tasmota devices leveraging Home Assistant auto discovery
Apache License 2.0
35 stars 9 forks source link

Tasmota ESP8266 (WeMosD1Mini) doesn‘t reach homebridge #22

Closed chimcen closed 3 years ago

chimcen commented 3 years ago

Describe Your Problem: Hi, followed your projects long time ago - great stuff! Thank you. Used (still using it) your mcuiot for my homebridge and just want to switch also to tasmota. I followed your instructions (flashed Tasmota, set Auto Discovery to on, installed homebridge tasmota, configured it there and also on my tasmota device), but on my tasmota device i‘ll get error „Connection failed .... rc -2“

Is this a problem to use homebridge-mcuiot and homebridge-tasmota at the same time?

How is the tasmota device to configure for use with a BME280?

Can you make such a awesome install/configuration description like the one from your mcuiot project?

NorthernMan54 commented 3 years ago

I remember you from a few years ago.

As I have been converting all my devices I have been keeping notes here as I needed to convert a lot of devices ( almost 60 ). My notes per device are here, and I included links to the build instructions for each as they are still running at my homes.

https://github.com/NorthernMan54/homebridge-tasmota/blob/beta/DEVICES.md

Once you have configured all your devices to use Tasmota you need to remove mcuiot. Tasmota and mcuiot are not compatible with each other and mcuiot will just give errors etc.

chimcen commented 3 years ago

Remember me could be good or bad... hahaha :)

Actually mcuiot doesn‘t make problem - but when i‘m configure my tasmo device correct it will do it for sure. But running both plugins wouldn‘t interrupt the connection between the tasmota device and my homebrige?

Checked your templates - 60 devices? Wow...

I used your BME Template and thought i should see then the measurements of BME280 in Tasmota Web GUI - but there is no output...

NorthernMan54 commented 3 years ago

With the BME sensor you need to use the sensors firmware, as the standard firmware doesn’t do i2c

And when it is working you should see the temperate in the Tasmota device web site

Over the years I had ended up with a lot of cheap eap8266 devices and had spent the summer flashing them all with tasmota and remove all the random plugins from my setup

In the end I counted them up, and had almost 60 split across my primary residence and vacation property. I had never realized I had collected that many until I saw them on the tasui list.

chimcen commented 3 years ago

Ah, my fault... with tasmota-sensors.bin i'm now able to see the measurements. Thank you. But if you remember - the same problem with the preasure as on mcuiot - the sea-lvl correction is missing... ;)

NorthernMan54 commented 3 years ago

As there are a lot of users of Tasmota, do they have a solution already ?

NorthernMan54 commented 3 years ago

Glad to hear you got it working, and am glad you have come along on my Tasmota journey

chimcen commented 3 years ago

Not completley - in TasUI i found the device and add it. The tasmota console of the device sends reading, but still connection failed...

01:00:19 RSL: stat/tasmota_73ECAC/STATUS6 = {"StatusMQT":{"MqttHost":"mqtt.local","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_73ECAC","MqttUser":"DVES_USER","MqttCount":0,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30}}
01:00:19 RSL: stat/tasmota_73ECAC/STATUS7 = {"StatusTIM":{"UTC":"2020-11-28T00:00:19","Local":"2020-11-28T01:00:19","StartDST":"2020-03-29T02:00:00","EndDST":"2020-10-25T03:00:00","Timezone":"+01:00","Sunrise":"08:19","Sunset":"16:57"}}
01:00:19 RSL: stat/tasmota_73ECAC/STATUS10 = {"StatusSNS":{"Time":"2020-11-28T01:00:19","BME280":{"Temperature":24.2,"Humidity":37.6,"DewPoint":8.8,"Pressure":972.3},"PressureUnit":"hPa","TempUnit":"C"}}
01:00:19 RSL: stat/tasmota_73ECAC/STATUS11 = {"StatusSTS":{"Time":"2020-11-28T01:00:19","Uptime":"0T00:11:40","UptimeSec":700,"Heap":20,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":189,"MqttCount":0,"Wifi":{"AP":1,"SSId":"CCG","BSSId":"F2:9F:C2:F7:DD:8B","Channel":4,"RSSI":38,"Signal":-81,"LinkCount":1,"Downtime":"0T00:00:05"}}}
01:00:19 RSL: stat/tasmota_73ECAC/STATUS12 = {"StatusSTK":{"Exception":29,"Reason":"Exception","EPC":["4000df64","00000000","00000000"],"EXCVADDR":"00000000","DEPC":"00000000","CallChain":["40101708","4026aa3f","40103a37","4026a9d4","4026a97b","40269ad8","40269b01","40267568","40103b66","402638d1","40258915","4026825f","40000f58","40267cd2","40271437","40270cf3","4024e904","40000f49","40000f49","40000e19","40105ce5","40105ceb","4010000d","4026fbd4","4026fb85","40100cb8","4010292c","40105bdf","401034c3","4000050c","40103888"]}}
01:00:19 RSL: stat/tasmota_73ECAC/RESULT = {"Module":{"0":"BME"}}
01:00:19 RSL: stat/tasmota_73ECAC/RESULT = {"WifiPower":"17.0"}
01:00:19 RSL: stat/tasmota_73ECAC/RESULT = {"Module":{"0":"BME"}}
01:00:19 RSL: stat/tasmota_73ECAC/RESULT = {"WifiPower":"17.0"}
01:00:19 RSL: stat/tasmota_73ECAC/RESULT = {"WifiPower":"17.0"}
01:00:26 MQT: Attempting connection...
01:00:36 MQT: Connect failed to mqtt.local:1883, rc -2. Retry in 10 sec
01:00:47 MQT: Attempting connection...
01:00:57 MQT: Connect failed to mqtt.local:1883, rc -2. Retry in 10 sec
chimcen commented 3 years ago

image image image

NorthernMan54 commented 3 years ago

In my setup I created an alias for my Mosquito server called mqtt.local. And this is saying that it cannot find your mqtt server.

To create the alias, I created this file on my mosquito server

nm@jesse:/etc/avahi/services$ cat mosquitto.service 
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
 <name replace-wildcards="yes">Mosquitto MQTT server on %h</name>
  <service>
   <type>_mqtt._tcp</type>
   <port>1883</port>
   <txt-record>info=Publish, Publish! Read all about it! mqtt.org</txt-record>
  </service>
</service-group>
chimcen commented 3 years ago

I'm stupid... i doesn't have a mosquito server installed cause i thought it would be a subpackage of homebridge-tasmota...

chimcen commented 3 years ago

Now it's working... the alias part i've to check later then...

You are using it on debian jesse? Just for info - i'm using it on a Pi4b at debian buster...

NorthernMan54 commented 3 years ago

I'm on buster as well

I'm using the alias as I have 2 'homes' and keep moving devices back and forth. Simplifies managing the configurations. If your not in that scenario, then it may not add a lot of value.

chimcen commented 3 years ago

Thought this because of nm@jesse: ...nevermind ;)

You're right - but it's more modern and afterwards easier to handle...

Do you have an idea to handle the preasure at sealevel? You remember the task on your mcuiot project?

Btw. thank you for your help. Great as usual

NorthernMan54 commented 3 years ago

For sea level, start on the Tasmota side. They have a very large user base and may have already solved the issue, or have a clever work around. The Tasmota firmware is very feature rich and may surprise you. I had stopped my own development work on ESP8266's after seeing how feature rich it was, and how far they have progressed in the last few years.

chimcen commented 3 years ago

Altidute xxx does the trick. Awesome whats possible with tasmota.

Today i got the response from homebridge (all added tasmota sensors are removed from homebridge automaticly): "availabilitySubscribe missing ..."

Could this be a reason because i renamed them (friendly name and device name)?

Any idea what this could be?

After changing the device name to "Tasmota" and the friendly name to "Sensor1" / "Sensor2" i got this: Sensor1 has the altitude flag set, sensor2 not.

[2020-11-28 10:54:26] Homebridge is running on port 51189. [2020-11-28 10:54:27] [Tasmota] Adding new accessory: Tasmota BME280 Temperature HAP Warning: Characteristic 000000E3-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 0000008A-0000-1000-8000-0026BB765291. Adding anyway. [2020-11-28 10:54:27] [Tasmota] Found existing accessory: Tasmota BME280 Humidity [2020-11-28 10:54:27] [Tasmota] Creating service: Tasmota BME280 Humidity sensor HAP Warning: Characteristic 000000E3-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 00000082-0000-1000-8000-0026BB765291. Adding anyway. [2020-11-28 10:54:27] [Tasmota] Found existing accessory: Tasmota BME280 DewPoint [2020-11-28 10:54:27] [Tasmota] Creating service: Tasmota BME280 DewPoint sensor [2020-11-28 10:54:27] [Tasmota] Found existing accessory: Tasmota BME280 Pressure [2020-11-28 10:54:27] [Tasmota] Creating service: Tasmota BME280 Pressure sensor HAP Warning: Characteristic 000000E3-0000-1000-8000-0026BB765291 not in required or optional characteristics for service B77831FD-D66A-46A4-B66D-FD7EE8DFE3CE. Adding anyway. [2020-11-28 10:54:27] [Tasmota] Found existing accessory: Tasmota status [2020-11-28 10:54:27] [Tasmota] Creating service: Tasmota status sensor [2020-11-28 10:54:27] [Tasmota] Found existing accessory: Sensor1 BME280 SeaPressure [2020-11-28 10:54:27] [Tasmota] Creating service: Sensor1 BME280 SeaPressure sensor HAP Warning: Characteristic 000000E3-0000-1000-8000-0026BB765291 not in required or optional characteristics for service B77831FD-D66A-46A4-B66D-FD7EE8DFE3CE. Adding anyway. [2020-11-28 10:54:27] [Tasmota] Adding new accessory: Tasmota BME280 Temperature HAP Warning: Characteristic 000000E3-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 0000008A-0000-1000-8000-0026BB765291. Adding anyway. [2020-11-28 10:54:27] [Tasmota] Found existing accessory: Tasmota BME280 Humidity [2020-11-28 10:54:27] [Tasmota] Creating service: Tasmota BME280 Humidity sensor HAP Warning: Characteristic 000000E3-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 00000082-0000-1000-8000-0026BB765291. Adding anyway. [2020-11-28 10:54:27] [Tasmota] Found existing accessory: Tasmota BME280 DewPoint [2020-11-28 10:54:27] [Tasmota] Creating service: Tasmota BME280 DewPoint sensor [2020-11-28 10:54:27] [Tasmota] Found existing accessory: Tasmota BME280 Pressure [2020-11-28 10:54:27] [Tasmota] Creating service: Tasmota BME280 Pressure sensor HAP Warning: Characteristic 000000E3-0000-1000-8000-0026BB765291 not in required or optional characteristics for service B77831FD-D66A-46A4-B66D-FD7EE8DFE3CE. Adding anyway. [2020-11-28 10:54:27] [Tasmota] Found existing accessory: Tasmota status [2020-11-28 10:54:27] [Tasmota] Creating service: Tasmota status sensor [2020-11-28 10:54:27] [Tasmota] Marking accessory 'Tasmota BME280 Temperature' to Online [2020-11-28 10:54:27] [Tasmota] Marking accessory 'Tasmota BME280 Humidity' to Online [2020-11-28 10:54:27] [Tasmota] Marking accessory 'Tasmota BME280 Pressure' to Online [2020-11-28 10:54:27] [Tasmota] Marking accessory 'Sensor1 BME280 SeaPressure' to Online [2020-11-28 10:54:27] [Tasmota] Marking accessory 'Tasmota BME280 Temperature' to Online [2020-11-28 10:54:27] [Tasmota] Marking accessory 'Tasmota BME280 Humidity' to Online [2020-11-28 10:54:27] [Tasmota] Marking accessory 'Tasmota BME280 Pressure' to Online [2020-11-28 10:54:27] [Tasmota] Updating 'Tasmota BME280 Temperature:Current Temperature' to 24 [2020-11-28 10:54:27] [Tasmota] Updating 'Tasmota BME280 Humidity:Current Relative Humidity' to 38.2 [2020-11-28 10:54:28] [Tasmota] Updating 'Tasmota BME280 Pressure:Air Pressure' to 972.6 [2020-11-28 10:54:28] [Tasmota] Updating 'Sensor1 BME280 SeaPressure:Air Pressure' to 1022.1 (node:8768) TimeoutOverflowWarning: 12960000000 does not fit into a 32-bit signed integer. Timeout duration was set to 1. (node:8768) TimeoutOverflowWarning: 12960000000 does not fit into a 32-bit signed integer. Timeout duration was set to 1. (node:8768) TimeoutOverflowWarning: 12960000000 does not fit into a 32-bit signed integer. Timeout duration was set to 1. (node:8768) TimeoutOverflowWarning: 12960000000 does not fit into a 32-bit signed integer. Timeout duration was set to 1. [2020-11-28 10:54:28] [Tasmota] Removing Accessory Tasmota BME280 Temperature [2020-11-28 10:54:28] [Tasmota] Removing Service Tasmota BME280 Temperature [2020-11-28 10:54:28] [Tasmota] availabilitySubscribe missing Tasmota BME280 Temperature [2020-11-28 10:54:28] [Tasmota] Removing Service Tasmota BME280 Humidity [2020-11-28 10:54:28] [Tasmota] availabilitySubscribe missing Tasmota BME280 Humidity [2020-11-28 10:54:28] [Tasmota] Removing Service Tasmota BME280 Pressure [2020-11-28 10:54:28] [Tasmota] availabilitySubscribe missing Tasmota BME280 Pressure [2020-11-28 10:54:28] [Tasmota] Removing Service Sensor1 BME280 SeaPressure [2020-11-28 10:54:28] [Tasmota] availabilitySubscribe missing Sensor1 BME280 SeaPressure [2020-11-28 10:54:28] [Tasmota] Updating 'Tasmota BME280 Temperature:Current Temperature' to 25.7 [2020-11-28 10:54:28] [Tasmota] Updating 'Tasmota BME280 Humidity:Current Relative Humidity' to 36.3 [2020-11-28 10:54:28] [Tasmota] Updating 'Tasmota BME280 Pressure:Air Pressure' to 972.3 (node:8768) TimeoutOverflowWarning: 12960000000 does not fit into a 32-bit signed integer. Timeout duration was set to 1. (node:8768) TimeoutOverflowWarning: 12960000000 does not fit into a 32-bit signed integer. Timeout duration was set to 1. (node:8768) TimeoutOverflowWarning: 12960000000 does not fit into a 32-bit signed integer. Timeout duration was set to 1. [2020-11-28 10:54:28] [Tasmota] Removing Accessory Tasmota BME280 Temperature [2020-11-28 10:54:28] [Tasmota] Removing Service Tasmota BME280 Temperature [2020-11-28 10:54:28] [Tasmota] availabilitySubscribe missing Tasmota BME280 Temperature [2020-11-28 10:54:28] [Tasmota] Removing Service Tasmota BME280 Humidity [2020-11-28 10:54:28] [Tasmota] availabilitySubscribe missing Tasmota BME280 Humidity [2020-11-28 10:54:28] [Tasmota] Removing Service Tasmota BME280 Pressure [2020-11-28 10:54:28] [Tasmota] availabilitySubscribe missing Tasmota BME280 Pressure

chimcen commented 3 years ago

Found the problem...i set the cleanup interval to 3600 (didn’t want that my homebridge deletes devices that are longer than 24hours are offline...). Could this be disabled?

chimcen commented 3 years ago

I've created the file "/etc/avahi/services/mosquitto.service" and pasted your code - mqtt.local doesn't work anyway... any idea?

NorthernMan54 commented 3 years ago

Does your setup run 'avahi' ?