rules with Tasmota

2,991 views
Skip to first unread message

d.m.ra...@gmail.com

unread,
Sep 12, 2018, 2:11:56 PM9/12/18
to SonoffUsers

Dear all.

I use tasmota and i will try to usse the rules..
Only i do not understand this part of tasmota...
So i use mutiple dallas sensors... And i need them to read with rules..
Only i cannot find a simple how to or example ...


So please someone have a example.....

And perhaps more examples for nice rules to use..


An better a wiki so i can learn step by step..

Philip Knowles

unread,
Sep 12, 2018, 2:15:45 PM9/12/18
to d.m.ra...@gmail.com, SonoffUsers

If you explain what you want to do someone will help

 

For example I want to switch on a relay if the temperature is higher than 25C

 

Otherwise it’s too vague.

 

Regards

 

Phil K

 

Sent from Mail for Windows 10

--
You received this message because you are subscribed to the Google Groups "SonoffUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

d.m.ra...@gmail.com

unread,
Sep 12, 2018, 2:20:44 PM9/12/18
to SonoffUsers
mmm Thanks.. for your react..
The simple thing i will start with...
Read out my 8 dallassensors...
so i can read the in my home automation [ domoticz ]

And then when there is more i hope you have some examples..
The difficult rules i cam make simple in Domoticz.

And i will try to use all the ins from the sonoff basic
So on the other rf and tx i will try to set a waterpulsecounter, and read this in domoticz
And a dht11 on the other pin..:-)

The fist thing read out the 8 dallas...:-)
Hope you knwo..
xxx



Op woensdag 12 september 2018 20:15:45 UTC+2 schreef Philip Knowles:

Philip Knowles

unread,
Sep 12, 2018, 2:30:37 PM9/12/18
to d.m.ra...@gmail.com, SonoffUsers

You don’t need a rule to read sensors because Tasmota automatically sends it one you configure the module. It is sent by MQTT so you need a MQTT broker. I use Mosquitto.

Here is an example of the output from a TH10 with 5 DS18B20 sensors

19:21:41 MQT: tele/sonoff-pump/SENSOR = {"Time":"2018-09-12T19:21:41","DS18B20-1":{"Id":"0417C15DF4FF","Temperature":20.1},"DS18B20-2":{"Id":"0517C143A6FF","Temperature":19.9},"DS18B20-3":{"Id":"0517C16908FF","Temperature":40.3},"DS18B20-4":{"Id":"0517C172E7FF","Temperature":38.0},"DS18B20-5":{"Id":"0517C17422FF","Temperature":21.4},"TempUnit":"C"}

I don’t know it works in Domoticz but in openHAB you create an item which strips the JSON. This is an example of how to read the first DS18B20 from the MQTT message

Number CHPump_Temperature "CH Flow Temperature [%.1f C]" (GroundFloor, TEMP) {mqtt="<[mosquitto:tele/sonoff-pump/SENSOR:state:JSONPATH($.DS18B20-1.Temperature)]"}

 

Hope that helps

d.m.ra...@gmail.com

unread,
Sep 12, 2018, 2:44:00 PM9/12/18
to SonoffUsers
Phil.
I can set 1 sensor that is automatic readout in tasmota and sens to Domoticz with MQTT  i can switch the device so that is working fine.
I see your output... that is what i can see in the consule:
19:31:47 RSL: tele/Drsjes-118/SENSOR = {"Time":"2018-09-12T19:31:47","COUNTER":{"C1":0},"DS18x20":{"DS1":{"Type":"DS18B20","Address":"28B8A226000080FD","Temperature":22.8},"DS2":{"Type":"DS18B20","Address":"2804371F05000080","Temperature":23.3},"DS3":{"Type":"DS18B20","Address":"28DC20E404000086","Temperature":23.6},"DS4":{"Type":"DS18B20","Address":"284ABA26000080A3","Temperature":22.6},"DS5":{"Type":"DS18B20","Address":"287B351F050000BF","Temperature":23.6},"DS6":{"Type":"DS18B20","Address":"28FF81E463160 ...
Only i cannot set more then 1 dallas.

Do i understand  it ok, when i say that i need a json for the other sensors?
Or is it possible to "push" the othere data from the sonoff to domoticz?

I do not understand how to use json in Domoticz...?
Is te json a lua script or something/


And what is teh max of dallassensors?


Op woensdag 12 september 2018 20:30:37 UTC+2 schreef Philip Knowles:

Philip Knowles

unread,
Sep 12, 2018, 3:04:37 PM9/12/18
to d.m.ra...@gmail.com, SonoffUsers

Dallas sensors are 1-wire sensors (DS18B20). You need to use the sensors.bin (which it looks like you are using) to use multiple sensors on one GPIO. And it looks like you are seeing the 8 on one GPIO but don’t forget to use a pullup resistor  https://github.com/arendst/Sonoff-Tasmota/wiki/Expanding-Sonoffs

 

There’s information on JSON https://github.com/arendst/Sonoff-Tasmota/wiki/JSON-Status-Responses

The issue seems to be at the Domoticz end as the JSON string has the sensors (DS1 etc)  in it. The JSON format is different to mine so that may the Domoticz config. There’s information on Domiticz https://github.com/arendst/Sonoff-Tasmota/wiki/Domoticz and https://github.com/arendst/Sonoff-Tasmota/wiki/Domoticz---Automatic-discovery

d.m.ra...@gmail.com

unread,
Sep 12, 2018, 3:09:49 PM9/12/18
to SonoffUsers
Phil

Thanks
Only one DOMBO question where do i put the json calls?
In a script?
Or a dummy switch?
Or?

Op woensdag 12 september 2018 21:04:37 UTC+2 schreef Philip Knowles:

Philip Knowles

unread,
Sep 12, 2018, 3:17:13 PM9/12/18
to d.m.ra...@gmail.com, SonoffUsers

In openHAB you create an Item which holds the value which was the example I gave

Number CHPump_Temperature "CH Flow Temperature [%.1f C]" (GroundFloor, TEMP) {mqtt="<[mosquitto:tele/sonoff-pump/SENSOR:state:JSONPATH($.DS18B20-1.Temperature)]"}

This says that the Item stores a Number and it’s referred to as CHPump_Temperature. The next bit explains how to display it then its location and finally how the information comes from MQTT broker..

I don’t know enough about Domoticz but I’m sure somebody else can help with that aspect.

Reply all
Reply to author
Forward
0 new messages