AtomBaf / homebridge-mqtt-tasmota

Homebridge handler for tasmota/MQTT devices
MIT License
5 stars 5 forks source link

Error with DS18B20 Temperature Sensor #12

Open vgr28 opened 4 months ago

vgr28 commented 4 months ago

Log. Error 7.2.2024, 11:05:04Mqtt Tasmota BridgeFEHLER[Mqtt Tasmota Bridge xxx@Temp. Warmwasser@Temp. Warmwasser@Current Relative Humidity] characteristic value expected valid finite number and received "NaN" (number) 7.2.2024, 11:07:18Mqtt Tasmota BridgeFEHLER[Mqtt Tasmota Bridge xxx@Temp. Warmwasser@Temp. Warmwasser@Current Relative Humidity] characteristic value expected valid finite number and received "NaN" (number) 7.2.2024, 11:10:04Mqtt Tasmota BridgeFEHLER[Mqtt Tasmota Bridge xxx@Temp. Warmwasser@Temp. Warmwasser@Current Relative Humidity] characteristic value expected valid finite number and received "NaN" (number)

Is it regarding the missing Humidity, because it's only Temperature Sensor?

AtomBaf commented 4 months ago

Hi On my side, I only have a DHT11 based device. The typical MQTT message looks like this:

{"Time":"2020-10-31T15:52:28","DHT11":{"Temperature":18.5,"Humidity":34.0,"DewPoint":2.3},"TempUnit":"C"}

I suppose that since you've no humidity and only temperature sensor the message will look like:

{"Time":"2020-10-31T15:52:28","DHT11":{"Temperature":18.5},"TempUnit":"C"}

Or maybe

{"Time":"2020-10-31T15:52:28","DHT11":{"Temperature":18.5,"Humidity":null,"DewPoint":null},"TempUnit":"C"}

If there is only one sensor I can see in the code that indeed it can behave wrongly, I'll look at it.

In the mean time could you please write here the MQTT message content you're receiving from your tasmota enabled device?

AtomBaf commented 4 months ago

I think I have a kind of answer from the tasmota doc The message should look like:

{"Time":"2020-10-31T15:52:28","DS18B20":{"Temperature":18.5},"TempUnit":"C"}

Apparently there are cases when tasmota can have multiple DS18B20 sensors, it is not yet handled so I hope you only have one. I'll fix the problem.

vgr28 commented 4 months ago

Thats my Mqtt message

SENSOR = {"Time":"2024-02-07T18:05:03","DS18B20":{"Id":"C265801E64FF","Temperature":56.8},"TempUnit":"C"}

AtomBaf commented 4 months ago

Ok, new release v0.12.0 published, you can now use temperature instead of sensor in your homebridge accessory json config file. I'm closing this issue but feel free to re-open if it is not working!

vgr28 commented 4 months ago

Hi, thanks but not working. Maybe missunderstanding on my side.

See my config { "accessories": [ { "name": "Temp. Warmwasser", "type": "temperature", "url": "mqtt://192.xxx.x.xx:1883", "topic": "tele/Temp._Warmwasser/temperature", "accessory": "mqtt-tasmota", "plugin_map": { "plugin_name": "homebridge-mqtt-tasmota" } } ] }

AtomBaf commented 4 months ago

Your config should look like this:

        {
            "accessory": "mqtt-tasmota",
            "type": "temperature",
            "name": "Temp. Warmwasser",
            "url": "mqtt://192.xxx.x.xx:1883",
            "topic": "Temp._Warmwasser"
        },

where Temp._Warmwasser is the MQTT name setup in Tasmota interface You probably don't need a plugin map entry If you're to build the topic yourself, the end is probably SENSOR and not temperature as you can see here