ITEAD Sonoff switches and sockets - cheap ESP8266 Wifi+MQTT hardware

mqtt
wifi
sonoff
Tags: #<Tag:0x00007fd31018f2f0> #<Tag:0x00007fd31018f160> #<Tag:0x00007fd31018efd0>

(Clint Crowe) #488

Hey Tom, I have it connected now and the sonoff is reporting the temp. Having an issue getting it to the sitemap.

my items:
String Indoor_State “[%s]” (startpersist) {mqtt="<[mosquitto:stat/sonoff-00th161/POWER:state:default]"}
Number Indoor_Temperature “Indoor Temperature” {mqtt="<[mosquitto:tele/sonoff-00th161/AM2301/TEMPERATURE:state:default]"}
Number Indoor_Humidity “Indoor Humidity” {mqtt="<[mosquitto:tele/sonoff-00th161/AM2301/HUMIDITY:state:default]"}

sitemap
Text item=Indoor_Temperature label=“Indoor Temperature” [%.1f °F] icon=“temperature”

I dont get any errors in the log. At first I thought it was because I had not changed the DHT to the AM2301 but that did not fix it.

i have mqtt action and persistence installed.

thanks!


(Tom) #489

When you say reporting, are you saying it’s being published and you see it using MQTT.fx?

If so, does the topic match your item definition exactly?

Does it have DHT or AM2301 in the topic?

You need to subscribe, in your case, to:

tele/sonoff-00th161/#

You should get loads of other stuff coming through too.


(Clint Crowe) #490

Ah, so that might be where there is an issue. When I try

tele/sonoff-00th161/# 

it shows as offline.

this is what i have in my mqtt parameters


(Tom) #491

My devices are older so use a different, less flexible topic arrangement:

Subscribe to the following and see what you get.

tasmota/# 

There’s some stuff on topic definition here


(James Derrick) #492

Remember that the Tasmota web interface console shows what is sending to MTTQ - e.g. any errors, and regular sensor readings broadcast into MQTT - you should probably see MQT: tele/sonoff-00th161/STATE

I expected the device to broadcast tele/* with both hostname and topic, but only saw topic - my initial Item config was looking for the wrong MQTT string.

Trace via the TH16 console, the MQTT monitor, the ESH console, then lastly a sitemap.


(Clint Crowe) #493

ok, so maybe getting close.

in the th16 console i have lines that flow like this:

tasmotasonoff-00th161/tele/SENSOR

in mqtt if i subscribe to just # i get: tasmotasonoff-00h161/tele and now if i subscribe to tasmotasonoff-00h161/tele/SENSOR I am getting data. the mqtt log shows messages arriving…

so it tried changing my items to :

Number Indoor_Temperature "Indoor Temperature"  {mqtt="<[mosquitto:tele/tasmotasonoff-00th161/AM2301/TEMPERATURE:state:default]"}

didnt work. then i tried:

tasmotasonoff-00th161/tele/SENSOR

that didnt do it either.

if i shutdown mqtt.fx and restart i get this in the log:

MqttFX ClientModel             : MqttClient with ID Openhab2 assigned.

assuming it is connecting to openhab2 at that point.


(Garry Mitchell) #494

If you try to connect with MQTTfx AND OpenHAB with the same ID, you will keep kicking devices off from the MQTT server.

Each one needs to be unique - the default settings of both OH configuration and MQTTfx should be sufficient to prevent this from happening - you often don’t need to change as much as you’ve been changing!

I would also highly recommend you reset the Sonoff/Tasmota MQTT properties back to as close to default as possible until you understand exactly what is happening, and what you are changing and why, with “Topic” being your unique name for the device, and “Full topic” being %prefix%/%topic%/

This way, all of the examples you see here should work simpler for you.

For reference, here are my configurations:
Configure MQTT:

Configure Module:
image

And my front page:
image

And my .items file looks like this:

Number ME_Temp1 "Megan Bedroom Temperature [%.1f °C]" <temperature> (gTemperature, gMegan, gFirstFloor, FirstFloorTempAvg) {mqtt="<[mosquitto:tele/sonoff-megan-1/SENSOR:state:JSONPATH($.AM2301.Temperature)]"}
Number ME_Humidity1 "Megan Bedroom Humidity [%.1f %%]" <humidity> (gHumidity, gMegan, gFirstFloor) {mqtt="<[mosquitto:tele/sonoff-megan-1/SENSOR:state:JSONPATH($.AM2301.Humidity)]"}

(Bert) #495

Hi all,
I’am having trouble getting the temperature from two Sonoff’s TH16 in my (test)sitemap.
Both Sonoff TH16 are working ok with MQTT, and the switch part of these Sonoff’s are also working in my openhanb (classic)UI. One Sonoff TH16 has the Si7021 tem. humid. sensor and the second Sonoff TH16 has the DS18B20 sensor.

This is the output of mosquitto mqtt broker when i issue the command:

mosquitto_sub -t "tasmota/+/tele/#" -v

tasmota/Sonoff_9TH/tele/SENSOR {"Time":"2018-02-26T12:21:37","SI7021":{"Temperature":17.8,"Humidity":38.4}}
tasmota/Sonoff_10TH/tele/SENSOR {"Time":"2018-02-26T12:35:34","DS18B20":{"Temperature":17,4}}

So that is looking perfect. But getting the result in my sitemap is giving me troubles.
( I also see the Temperature and Humidity in the Tasmota web configuration.)
Here are the items i created (with the configs i allready tried:

Switch 	    Sonoff_9TH 	"EE_3 Sonoff_9TH" 	        <light> (EE_Werk2,LR,gLight)
    { mqtt=">[mybroker:tasmota/Sonoff_9TH/cmnd/POWER:command:ON:1],
            >[mybroker:tasmota/Sonoff_9TH/cmnd/POWER:command:OFF:0],
            <[mybroker:tasmota/Sonoff_9TH/stat/POWER:state:default]" }           
//
// Number      Sonoff_9TH_Temp      "Sonoff Temperature [%.1f °C]"      <temperature> 
//    { mqtt="<[mybroker:tele/Sonoff_9TH/SENSOR:state:JSONPATH($.AM2301.Temperature)]" } 
Number 	Sonoff_9TH_Temp  "Temperatuur EE_3 [%.1f °C]" 		<temperatuur>	(EE_Werk2)             
	{mqtt="<[mybroker:tasmota/Sonoff_9TH/tele/SENSOR:state:temperature)]"}
	// {mqtt="<[mybroker:tasmota/Sonoff_9TH/tele/SENSOR:state:JSONPATH($.SI7021.DS1.Temperature)]"}
		
Number	Sonoff_9TH_Humidity	"Lucht vochtigheid EE_3 [%.1f %%]"	<Climate>	(Temperatures)		
	// { mqtt="<[mybroker:tasmota/Sonoff_9TH/Humidity:state:default]" }
	{ mqtt="<[mybroker:tasmota/Sonoff_9TH/Temperature:state:default]" }
//
//
Switch 	    Sonoff_10TH 	    "EE_3 Sonoff_10TH" 		    <light> (EE_Werk2,LR,gLight)
    { mqtt=">[mybroker:tasmota/Sonoff_10TH/cmnd/POWER:command:ON:1],
            >[mybroker:tasmota/Sonoff_10TH/cmnd/POWER:command:OFF:0],
            <[mybroker:tasmota/Sonoff_10TH/stat/POWER:state:default]" }
//
Number 	Sonoff_10TH_Temp  "Temperatuur EE_3 [%.1f °C]" 	<temperatuur>		(EE_Werk2)             
	{mqtt="<[mybroker:tasmota/Sonoff_10TH/tele/SENSOR:state:JSONPATH($.DS18B20.DS1.Temperature)]"}
	// { mqtt="<[mybroker:/tasmota/Sonoff_10TH//Temperature:state:default]" }

The sitemap file entries are these:

Switch 	item=Sonoff_9TH			label="Sonoff 9 aan/uit"		icon="light"
Text 	item=Sonoff_9TH_Temp	label="Temperatuur  Sonoff 9 [%.1f °C]"	
//
Switch 	item=Sonoff_10TH		label="Sonoff 10 aan/uit"		icon="light"
Text 	item=Sonoff_10TH_Temp	label="Temperatuur  Sonoff 10 [%.1f °C]"	

Both Switch entries are working perfectly. My problem is getting the right mqtt string from the cli translated to the right string for the items file…

The MQTT parameters in the Tasmota config are:
Topic = Sonoff_9TH resp. Sonoff_10TH, and Full Topic: tasmota/%topic%/%prefix%/
(Note that i exchanged the %prefix% and %topic% in the Full Topic, as seen on the Sonoff-Tasmota Wiki.)

BTW; the JSONPath Transformation has been installed.

Hopefully someone can help me with this.
Kind regards, Bert


(Markus Haack) #496

@deltabert I think the JSONPath should do the trick.

For a TH16 with SI7021 sensor I use the following:

Number Sensor_Outdoor_Temp                  "Temperatur [%.1f °C]"                  <temperature>       (gOutdoor,gHouse,gTemperature)          [ "CurrentTemperature" ]        {mqtt="<[mosquitto:tele/sonoff-volvolicht/SENSOR:state:JSONPATH($.SI7021.Temperature)]" }
Number Sensor_Outdoor_Humidity              "Luftfeuchtigkeit [%.0f %%]"            <humidity>          (gOutdoor,gHouse,gHumidity)             [ "CurrentHumidity" ]           {mqtt="<[mosquitto:tele/sonoff-volvolicht/SENSOR:state:JSONPATH($.SI7021.Humidity)]" }

In your example I see:

{mqtt="<[mybroker:tasmota/Sonoff_9TH/tele/SENSOR:state:JSONPATH($.SI7021.DS1.Temperature)]"}

IT has SI7021.DS1.Temperature I think DS1 needs to be removed.

Markus


(Bert) #497

Hello Markus, Thank you for your reaction. The first thing i changed was your last remark about the SI7021. Removed the DS1. That did the trick. When i restarted the Sonoff, i received the temperature. :slight_smile:
I found this cfg somewhere while searching for a solution. I have to get to understand the JSONPath syntax… Must find more information about this; it’s new to me.
Anyway, the temperature sensor is working now. Now i have still a problem with the Humidity.

In my sitemap:

Text 		Sonoff_9TH_Humidity		label="Luchtvochtigheid Sonoff 9 " 

And in the items file:

Number 	Sonoff_9TH_Temp  	"Temperatuur EE_3 [%.1f °C]" 			<temperatuur>		(EE_Werk2)             
	{mqtt="<[mybroker:tasmota/Sonoff_9TH/tele/SENSOR:state:JSONPATH($.SI7021.Temperature)]"}

Number	Sonoff_9TH_Humidity	"Lucht vochtigheid EE_3 [%.1f %%]"	<Climate>			(family_room,Temperatures)		
	{mqtt="<[mybroker:tasmota/Sonoff_9TH/tele/SENSOR:state:JSONPATH($.SI7021.Humidity)]"}

My sitemap is not showing anymore with a HTTP ERROR 500.
When i comment out the Humidity line, the sitemap is visible. Any idea what is wrong here?

Update;
Humidity is also working now. I made a typo in the items definition. :frowning:
Once more, thank you for looking into my issue!
Kind regards, Bert


(Bert) #498

Still having problems with the Sonoff with the DS18B20 sensor.
This is the items def:

Switch	Sonoff_10TH 		"EE_3 Sonoff_10TH" 		    		<light> (EE_Werk2,LR,gLight)
	{ mqtt=">[mybroker:tasmota/Sonoff_10TH/cmnd/POWER:command:ON:1],
            >[mybroker:tasmota/Sonoff_10TH/cmnd/POWER:command:OFF:0],
            <[mybroker:tasmota/Sonoff_10TH/stat/POWER:state:default]" }
Number 	Sonoff_10TH_Temp  	"Temperatuur EE_3 [%.1f °C]" 		<temperatuur>		(EE_Werk2)  
	{mqtt="<[mybroker:tasmota/Sonoff_10TH/tele/SENSOR:state:JSONPATH($.DS18x20.Temperature)]"}

And this is the sitemap def:

Switch 	item=Sonoff_10TH		label="Sonoff 10 aan/uit"			icon="light"
Text 	item=Sonoff_10TH_Temp		label="Temperatuur  (Sonoff 10) [%.1f °C]"	icon="temperature"

I tried it also with JSONPATH($.DS18x20**.DS1**.Temperature)
But without success.
The broker sends this when i ask it:

bert@openhab-bpro:~$ mosquitto_sub -t "tasmota/Sonoff_10TH/tele/SENSOR/#" -v

tasmota/Sonoff_10TH/tele/SENSOR {"Time":"2018-02-27T09:23:43","DS18B20":{"Temperature":16,6}}
tasmota/Sonoff_10TH/tele/SENSOR {"Time":"2018-02-27T09:28:50","DS18B20":{"Temperature":16,8}}
tasmota/Sonoff_10TH/tele/SENSOR {"Time":"2018-02-27T09:33:57","DS18B20":{"Temperature":17,0}}
tasmota/Sonoff_10TH/tele/SENSOR {"Time":"2018-02-27T09:39:04","DS18B20":{"Temperature":17,2}}
tasmota/Sonoff_10TH/tele/SENSOR {"Time":"2018-02-27T09:44:11","DS18B20":{"Temperature":17,3}}

Any idea what i am doing wrong here? The other Sonoff with the Si7021 for Temp and Humidity is working perfectly.


(Jürgen Baginski) #499

My guess it is a typo, you use “DS18x20” in the item definition, but broker sends “DS18B20”.


(Bert) #500

Hi Jürgen,
No i do not think that is the problem. I have tried it with the following cfg’s:

JSONPATH($.DS18B20.DS1.Temperature)
JSONPATH($.DS18B20.Temperature)
JSONPATH($.DS18x20.DS1.Temperature)
JSONPATH($.DS18x20.Temperature)

But when i look into the openhab log, with every change in this items file i get the following Warning messages:

2018-02-27 13:38:26.306 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'mqtt.items'
2018-02-27 13:38:52.117 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'mqtt.items'
2018-02-27 13:38:52.589 [WARN ] [.core.transform.TransformationHelper] - Transformation 'org.eclipse.smarthome.transform.map.internal.MapTransformationService@1d2b72d' with value 'NULL' failed: An error occurred while opening file.
2018-02-27 13:38:52.626 [WARN ] [.core.transform.TransformationHelper] - Transformation 'org.eclipse.smarthome.transform.map.internal.MapTransformationService@1d2b72d' with value 'NULL' failed: An error occurred while opening file.
2018-02-27 13:38:52.636 [WARN ] [.core.transform.TransformationHelper] - Transformation 'org.eclipse.smarthome.transform.map.internal.MapTransformationService@1d2b72d' with value 'NULL' failed: An error occurred while opening file.

I do’nt know if that has something to do with the DS18B20 sensor. My other sensor the Si7021 is using also JSONPATH, and is working OK, both Temp and Humidity.
I do not know it it helps but i added the following to my …/transform/binary.map file:

key=value
1=ON
0=OFF
ON=1
OFF=0
NULL=unknown
-=unknown

As what the transformations concerns, i starten with installing jsonpath- and map transformation. Later on i also included, one-by-one, Exec-, Javascript-, Xpath- en Xslt tranformations, but this did not change the behaviour.

I just restarted openhab and most transformations were uninstalled:

2018-02-27 13:51:08.466 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2018-02-27 13:51:08.656 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
2018-02-27 13:51:33.384 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-transformation-xpath'
2018-02-27 13:51:49.328 [WARN ] [.core.transform.TransformationHelper] - Transformation 'org.eclipse.smarthome.transform.map.internal.MapTransformationService@1b5d4ea' with v   alue 'NULL' failed: An error occurred while opening file.
2018-02-27 13:51:49.410 [WARN ] [.core.transform.TransformationHelper] - Transformation 'org.eclipse.smarthome.transform.map.internal.MapTransformationService@1b5d4ea' with v   alue 'NULL' failed: An error occurred while opening file.
2018-02-27 13:51:49.428 [WARN ] [.core.transform.TransformationHelper] - Transformation 'org.eclipse.smarthome.transform.map.internal.MapTransformationService@1b5d4ea' with v   alue 'NULL' failed: An error occurred while opening file.
2018-02-27 13:51:54.510 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-transformation-map'
2018-02-27 13:52:18.522 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-transformation-javascript'
2018-02-27 13:52:37.630 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-transformation-xslt'
2018-02-27 13:52:47.957 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type MAP
2018-02-27 13:52:47.968 [WARN ] [.core.transform.TransformationHelper] - Couldn't transform value because transformation service of type 'MAP' is not available.
2018-02-27 13:52:48.003 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type MAP
2018-02-27 13:52:48.010 [WARN ] [.core.transform.TransformationHelper] - Couldn't transform value because transformation service of type 'MAP' is not available.
2018-02-27 13:52:48.021 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type MAP
2018-02-27 13:52:48.028 [WARN ] [.core.transform.TransformationHelper] - Couldn't transform value because transformation service of type 'MAP' is not available.
2018-02-27 13:52:56.044 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-transformation-exec'
2018-02-27 13:53:14.783 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-transformation-jsonpath'
2018-02-27 13:53:43.318 [ERROR] [t.mqtt.internal.MqttBrokerConnection] - MQTT connection to broker was lost
org.eclipse.paho.client.mqttv3.MqttException: MqttException
        at org.eclipse.paho.client.mqttv3.internal.CommsCallback.run(CommsCallback.java:197) [216:org.openhab.io.transport.mqtt:1.12.0.201802180209]
        at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.lang.NoClassDefFoundError: com/jayway/jsonpath/Predicate
        at org.eclipse.smarthome.transform.jsonpath.internal.JSonPathTransformationService.transform(JSonPathTransformationService.java:57) ~[?:?]
        at org.openhab.core.transform.TransformationHelper$TransformationServiceDelegate.transform(TransformationHelper.java:65) ~[?:?]
        at org.openhab.binding.mqtt.internal.MqttMessageSubscriber.processMessage(MqttMessageSubscriber.java:138) ~[?:?]
        at org.openhab.io.transport.mqtt.internal.MqttBrokerConnection.messageArrived(MqttBrokerConnection.java:556) ~[?:?]
        at org.eclipse.paho.client.mqttv3.internal.CommsCallback.deliverMessage(CommsCallback.java:475) ~[?:?]
        at org.eclipse.paho.client.mqttv3.internal.CommsCallback.handleMessage(CommsCallback.java:379) ~[?:?]
        at org.eclipse.paho.client.mqttv3.internal.CommsCallback.run(CommsCallback.java:183) ~[?:?]
        ... 1 more
Caused by: java.lang.ClassNotFoundException: com.jayway.jsonpath.Predicate cannot be found by org.eclipse.smarthome.transform.jsonpath_0.10.0.201802191927
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:410) ~[?:?]
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:372) ~[?:?]
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:364) ~[?:?]
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161) ~[?:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:?]
        at org.eclipse.smarthome.transform.jsonpath.internal.JSonPathTransformationService.transform(JSonPathTransformationService.java:57) ~[?:?]
        at org.openhab.core.transform.TransformationHelper$TransformationServiceDelegate.transform(TransformationHelper.java:65) ~[?:?]
        at org.openhab.binding.mqtt.internal.MqttMessageSubscriber.processMessage(MqttMessageSubscriber.java:138) ~[?:?]
        at org.openhab.io.transport.mqtt.internal.MqttBrokerConnection.messageArrived(MqttBrokerConnection.java:556) ~[?:?]
        at org.eclipse.paho.client.mqttv3.internal.CommsCallback.deliverMessage(CommsCallback.java:475) ~[?:?]
        at org.eclipse.paho.client.mqttv3.internal.CommsCallback.handleMessage(CommsCallback.java:379) ~[?:?]
        at org.eclipse.paho.client.mqttv3.internal.CommsCallback.run(CommsCallback.java:183) ~[?:?]
        ... 1 more
2018-02-27 13:53:43.532 [ERROR] [t.mqtt.internal.MqttBrokerConnection] - MQTT connection to 'mybroker' was lost: MqttException : ReasonCode 0 : Cause : com/jayway/jsonpath/Pr   edicate
2018-02-27 13:53:43.538 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting connection helper to periodically try restore connection to broker 'mybroker'
2018-02-27 13:53:53.546 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'mybroker'
2018-02-27 13:53:58.923 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type MAP
2018-02-27 13:53:58.928 [WARN ] [.core.transform.TransformationHelper] - Couldn't transform value because transformation service of type 'MAP' is not available.
2018-02-27 13:53:58.956 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type MAP
2018-02-27 13:53:58.960 [WARN ] [.core.transform.TransformationHelper] - Couldn't transform value because transformation service of type 'MAP' is not available.
2018-02-27 13:53:58.967 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type MAP
2018-02-27 13:53:58.971 [WARN ] [.core.transform.TransformationHelper] - Couldn't transform value because transformation service of type 'MAP' is not available.

I see that the connection to the mqtt broker gets lost and is started again???
Also, in PaperUI i see all that all transformations are uninstalled…
And when i install JSONPath Transformation again, my Si7021 sensor is no longer working :frowning:

The install is a test on an Banana Pro with ssd on sata interface. It is a new install, on which i firtst wanted to try my new Sonoff TH16 with the sensors.
If that would work fine i am planning to transfer my current install on RPi2 to this platform.
I do not understand why the Sonoff with the Si7021 has stopped functioning in my sitemap; i did not touch this part of the config.
And on my tty sessies i see both Sonoff/sensor reacting on the mosquitto_sub commands…
Hopefully someone has a suggestion?

Is there perhaps a way to do this without using JSONPath?

Update.
Updated my openhab snapshot. had to reinstall all UI’s and Addons. Now the Sonoff/Si7021 is working again. But Sonoff/DS18B20 not. Still the folowing Map Transformation warnings about a NULL value:

2018-02-27 16:19:48.906 [WARN ] [.core.transform.TransformationHelper] - Transformation 'org.eclipse.smarthome.transform.map.internal.MapTransformationService@15a1e55' with value 'NULL' failed: An error occurred while opening file.

(Josar) #501

@deltabert I don’t see any map transformation in your postings above .

Do you have other items, or sitemap elements which uses the map transformation?

How do you install Karaf , paper UI, cfg configuration? There is a bug which uninstalls bindings which where installed with Karaf.
There are also complains about auto uninstalled bindings when installed with paperUI.

Try to install all transformation you need in one go.


(Jürgen Baginski) #502

Just got my temp-sensor being detected by openHAB (started with that yesterday :wink: using a AM2301 sensor). According to my (limited) findings and your posted responses from the Sonoff_TH your item should be set like:

Number 	Sonoff_10TH_Temp  	"Temperatuur EE_3 [%.1f °C]" 		<temperatuur>		(EE_Werk2)  
	{mqtt="<[mybroker:tasmota/Sonoff_10TH/tele/SENSOR:state:JSONPATH($.DS18B20.Temperature)]"}

Regarding the errors pointing to a map transformation, I’d remove the NULL line, just to try it.


(Bert) #503

Thanks @opus and @Josar for thinking with me.
First Jürgen, your item looks exactly the same as the one i used. But nevertheless i copied it one2one to my items file. Unfortunately it did not help, it still does not work.

At the moment my mqtt binding is working; which helps so i can see that the other Sonoff/Si7021 is still, or again, working.

@Josar, this is still a (newly installed) test system, with only items for three Sonoffs. One is an older which still has the ESPEasy fw and does not use the JSONPath Transformation in the item. The other two items are my two new Sonoff TH16 (tasmota fw) with the two different sensors.
For these both i have Switch items (which also us e JSONPath Transformation and these Switches are working perfectly, as is the Si7021 sensor.

I have in my /conf/tranform directory 4 .map files; binary.map, de.map, en.map and reachable.map.
In the binary.map file i placed the NULL, which you can see in my prevous entry here.
I still get the WARN about the ‘NULL’ failure though…

Ps. I still see the output from mosquitto_sub:

tasmota/Sonoff_10TH/tele/SENSOR {"Time":"2018-02-27T18:45:10","DS18B20":{"Temperature":17,2}}
tasmota/Sonoff_10TH/tele/SENSOR {"Time":"2018-02-27T18:50:22","DS18B20":{"Temperature":17,2}}
tasmota/Sonoff_10TH/tele/SENSOR {"Time":"2018-02-27T18:55:34","DS18B20":{"Temperature":17,2}}


(Thomas Bail) #504

Just an idea, the temperature is written with a comma 17,2 and the delimiter in JSON ist the comma too. With a toll like mqttspy you should be able to publish your own messages and you should be able to simulate the sonoff. so try to send as a workload you could post

{"Time":"2018-02-27T18:55:34","DS18B20":{"Temperature":17}}

If it works we have fpound the problem. on the other hand you should be able to shrink he message. just publish only the time and try to read ist into a sting. If it works go to the next step publish a number and so on


(Jürgen Baginski) #505

Good point (or comma), I didn’t see that one and it makes me wonder why this different decimal seperator is used.
I have only a limited knowledge of MQTT but IMHO that should not be. I flashed my sonoff with a _de .bin file and do not get the comma. @Bert did you do something special?


(Bert) #506

But that should apply to the two Sonoff TH16’s! and i can’t see the rational that one is working perfectly and the other has problems. Both Sonoff 16TH are flashed one aftyer the other with the same Sonoff-Tasmota fw versien 5.11.1. (And with the web if of the Sonoffs i just cheched this!)
I am familiar with MQTTfx, and will try this to publish some messages.
Thanks guys for thinking with me.
To be continued…

Ps. these are te messages from both Sonoffs from which teh Sonoff_9TH is perfectly working:

tasmota/Sonoff_9TH/tele/SENSOR {"Time":"2018-02-27T19:43:35","SI7021":{"Temperature":9.3,"Humidity":47.3}}
tasmota/Sonoff_9TH/tele/SENSOR {"Time":"2018-02-27T19:48:46","SI7021":{"Temperature":9.3,"Humidity":47.3}}
tasmota/Sonoff_9TH/tele/SENSOR {"Time":"2018-02-27T19:53:57","SI7021":{"Temperature":9.3,"Humidity":47.4}}
tasmota/Sonoff_9TH/tele/SENSOR {"Time":"2018-02-27T19:59:08","SI7021":{"Temperature":9.3,"Humidity":47.3}}
and
tasmota/Sonoff_10TH/tele/SENSOR {"Time":"2018-02-27T19:47:42","DS18B20":{"Temperature":17,9}}
tasmota/Sonoff_10TH/tele/SENSOR {"Time":"2018-02-27T19:52:57","DS18B20":{"Temperature":18,1}}
tasmota/Sonoff_10TH/tele/SENSOR {"Time":"2018-02-27T19:58:11","DS18B20":{"Temperature":18,1}}
tasmota/Sonoff_10TH/tele/SENSOR {"Time":"2018-02-27T20:03:25","DS18B20":{"Temperature":18,3}}

(Jürgen Baginski) #507

Not to sure about all that, but that output migth be special for that sensor! It migth either use the comma hardcoded or react on a regional setting of your used .bin file.
Your update above with the MQTT messages from both sensors seems to point into that direction also.

Keep in mind I’m only guessing!