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

If you do not want to use the relay you can ignore the power PCB completely and source the ESP8285 directly.

You’ll need to provide 3.3V but you could additionally install one of these to work with 12V or 24V.

1 Like

Has anybody got the Sonoff Dimming LED to work?

It is stated on the Tasmota page that it is compatible. But I can not program it (I have the standard Sonoff working). I have not found any special instruction to program this one. Any clues?

https://www.itead.cc/sonoff-led.html

Did you see the discussion here: https://github.com/arendst/Sonoff-Tasmota/issues/122
Follow the normal instructions as can be found here: https://github.com/arendst/Sonoff-Tasmota/wiki/Hardware-Preparation#bringing-the-module-in-flash-mode
If it doesn’t work your best bet is a posting in the issue ticket system above.
While having the housing opened, could you take a few pictures!?

Does anyone one have working MQTT commands for the below?

Device: Sonoff SC
Firmware: Sonoff-Tasmota v5.1.7
OpenHAB 2

I flash firmware successfully and able to see sensors status via the device web portal but could not get MQTT to pull the data from the device into OpenHab.

MQTT is setup correctly because i have 3 x sonoff basic + 2 sonoff s20 using MQTT with my openHABB 2 setup.

Need MQTT command for the below:

  • Temperature
  • Humidity
  • Light
  • Noise
  • Air Quality

Tried the below but could not work for any of the sensors.
Number Hall_Noise “Hall Noise [%.1f]” (sensors) { mqtt="<[broker:tele/hallsensor/Temperature:state:default]" }

I’ve described how to define Items for new values here: https://github.com/arendst/Sonoff-Tasmota/wiki/openHAB#integration - The complete article should include all guidance you need, be sure to read it carefully.

In short:

  • Connect to your broker with a PC mqtt client like mqtt-spy
  • Subscribe to all topics of your sonoff: +/hallsensor/# (Is your sonoff really called “hallsensor”? :confused:)
  • Observe incoming messages
  • Build items similar to how it’s shown for the BA_Washingmachine_Power example

Please post your results to include them in the wiki!! Thanks

Hello,

I am using a Sonoff sc with Tasmota firmeware. Because the DHT11 sensor shows more than 5 degree difference to my other room temperature sensor I want to connect a DHT 22 sensor to gpio 2, which is also possible for the configuration in the web interface of the tasmota software. My question is: where can I find gpio 2 on the board to connect the sensor? I don’t find an information to this point.

Thank you for your help!

Hi,

Need a little help with reading a temperature and humidity value from a DHT22 sensor, I have openhab installed, configured, and working correctly with MQTT using ESPeasy for the Node1MCU, so I know that is not the issue currently.

I have a switch that I used outdoors that has a relay (works fine, can switch on and off at will) and a DHT22 temp/humidity sensor attached. This is the output that my MQTT broker receives:

tele/deck_lights/SENSOR {"Time":"2017-06-25T16:41:24", "DHT22":{"Temperature":28.1, "Humidity":68.7}}

And since this is JSONpath, i’ve added what I think is the appropriate item in my items file:

Number		outdoortemp		"Outdoors Temperature [%.1f °C]"		<temperature>		{mqtt="<[broker:tele/deck_lights/SENSOR:state:JSONPATH($.Time.DHT22.Temperature)]"}

I’ve tried remove the .Time.DHT22 before temperature but I always get a null reading. I can see the values incoming in my MQTT broker as well. Not sure why I cannot figure this one out. I read through the material, but I did not find anything relating directly back to this.

Thanks,

Why don’t you directly read the sensor data via MQTT binding?

Items file example:

Number Humidity "Humidity [%d %%]" { mqtt="<[mosquitto:/esp8266one/dht22/humidity:state:default]" }
Number Temperature "Temperature [%.1f °C]"  { mqtt="<[mosquitto:/esp8266one/dht22/temperature:state:default]" }

You need to adjust the example to your topics …

1 Like

That is what I am doing (i think; using the 1.9 binding), but I cannot parse the temperature data from the string.

No need to do that, you can directly read the data into a number item.
In ESPEasy on the “Config” tab, set “Protocol” to openHAB MQTT and fill in the server data.
On the “Tools” “Advanced tab” you can see the “Publish template” for the topic:
/%sysname%/%tskname%/%valname%
On my system that topic is /esp8266one/dht22/temperature
Now put that into the mqtt channel of a number item and that’s it (see my example above)

Edit:
sysname= Config tab->Main settings->Name
tskname=Devices->Edit->Name
valname=Devices->Edit->Value Name 1

2 Likes

sihui 's solution might be a good one. The same solution is working at my home.
On the MQTT-Topics you receive no JSON-Response but just a number…

With your solution and the given JSON respone your JSONPATH is wrong. You should try "JSONPATH($.DHT22.Temperature)"
because Time and DHT22 are in the same level of your JSON structure…

Andreas

Hello!

I know this isn’t OH related, but since many users have this hardware, maybe someone could help me. I’ve bought a few Sonoff Touch wall switches (EU version), but it doesn’t have those spiky handles (don’t know how they are called) on the sides (that hold a switch in a wall box), which are found in regular EU wall switches. How do you install it, and attach it to the wall (or in the wall box)?

Best regards,
Davor

With screws… There are holes in the touch switch and there are holes in the flash mount thing in your wall too. In germany there are the holes, but don´t know how this is in other european countries.

Look here:

And here:

3 Likes

Hello!

Thank you a lot for this information. I’ve noticed screw holes on the switch, but I thought I would have to drill holes in the wall to screw it in. I’ll have to take a closer look at the wall box, since it’s covered with plaster and paint, to see if there are holes in it.

Best regards,
Davor

Hi All,

just received my modules and prepared the hardware as described. Now it is comming to the point to flash the new firmware. Could someone give an advice wich way PlatformIO or Arduino IDE ist the easiest, non system invasive, recommanded and so way to flash. Or is this just a throw the coin decision?

Thanks
Thomas

@Dibbler42 Take a look at this https://www.youtube.com/watch?v=n4MDRm2yAJg&feature=youtu.be

And like you said, throw a coin or decide for yourself what you prefer more.

2 Likes

Thanks for that link, that saves a lot of time and i will give platform io a try.

Thomas

1 Like

Go with Platform IO. Way easier.
Check out the first posting to find the details.

Hello there,
I have few sonoff devices working properly and using mqtt.fx to monitor the traffic.
If I send a message like cmnd/sonoff/restart 1, the device will restart.
The maintenance rule doesn’t work for me and I don’t understand why…doesn’t seem to broadcast any messages when either of the buttons are pressed.
In the events.log I can see the status changed for Sonoff action
What am I missing?

is your broker properly defined?