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

Sorry guys, I only got the notification now. After a lot of digging I found out that it is listening to topic gpio/12 and I send 1 or 0 to active. It was just not clear to me. I thought I need to configure an output in the devices and that got me down that rabbit hole.

Anyway, I managed to get it working with but I still need to play around with rules.

I am sure. If you just want to switch on a light the simpler firmware looks good. But I have added sensors to some of my devices. Yes I could code myself to add this function, but espeasy already reads the sensors that I need, and I like the rules it offers as well.

Thanks for the info. My Sonoff is still waiting in the box to get unpacked and because I like ESPEasy (I’m using it for my nodemcu ESP8266) I will try it …

Hello

Right now I am using the arendst firmware.
I can switch on/off the relay of the SONOFF TH10 but I am not able to read out the temp and humi…

Is there anyone that can share the item file for SONOFF products with arendst firmware?

Number Temperature "Temperature [%.1f °C]"      <temperature>           {mqtt="<[broker:/tele/TH10/DHT/TEMPERATURE:state:default]"}
Number Humidity "Humidity [%.1f %%]"            <climate>               {mqtt="<[broker:/tele/TH10/DHT/HUMIDITY:state:default]"}
Switch Relay                                    <switch>                {mqtt=">[broker:/cmnd/TH10/power:command:ON:1],>[broker:/cmnd/TH10/power:command:OFF:0]"}

I do not own a TH10. Things that come to mind: Did you configure your device to send these values? Did you subscribe to the topic yourself to see if values are actually coming in?

Yes I did and I can see the temp when I am subscribing to this topic:

pi@raspberrypi:/ $ mosquitto_sub -t "tele/TH10/DHT/TEMPERATURE"
22.4

and I can´t see in the Log that OpenHAB is reading this value.

You need to subscribe to the same topic in your items file:

Number Temperature "Temperature [%.1f °C]" <temperature> {mqtt="<[broker:tele/TH10/DHT/TEMPERATURE:state:default]"}

Note the absence of the leading slash!

1 Like

It is working

Thanks :smile:

1 Like

You’ve got the sharp eye :thumbsup: @klond it’s often these little details that drive us crazy :wink:

1 Like

I’m curious if anyone uses a button control with Arendst firmware?
I can control a relay from OH but for some reasons I cannot read a status of the button.
I see an update in mosquitto_sub:

root@rpi:~# mosquitto_sub -t cmnd/# -v
cmnd/sonbutt1/POWER ON

In the event.log:

WiFiButton1 state updated to ON

this is my Item:

Switch WiFiButton1 “Sonoff #1 (mqtt)” { mqtt="<[rpilocalbroker:cmnd/sonbutt1/POWER:state:ON]" }

this is a basic rule:

// Sonoff button
rule "Button"
when
Item WiFiButton1 changed to ON
then
logInfo(“sonoff”, “button pressed”)
end

See this error in the log:

Error during the execution of rule ‘Button’: Index: 1, Size: 1

Edit: sorted out, made a mistake in logger name.
Anyway, will appreciate all the comments on this configuration.

There is a new device Sonoff SC.
https://www.itead.cc/sonoff-sc.html

It can measure humidity, temperature, pollution, sound …

Is there a way to include this in openhab too?

Wow that’s cool :wink: I’ll definitely look into that.
Can be integrated for sure. Just like with the other Itead devices the firmware will need reflashing (details) and a firmware to flash it with. I’m betting on arendst or some contributor to provide a firmware soon.

I’ve seen that there are two wiki websites referring to ITEAD products:

  1. the official one accessible from the ITEAD wiki
  2. the raspberryinfo website raspberrywiki linked from banggood.com
    The second one seems just a reseller website, but it shows products not available on the official ITEAD website: are these prototypes, or discontinued products? Does someone know something more about these “non official” products?
    Thank you for your attention

Outdated products I believe. The page doesn’t seem like a complete source for information.

On a side note: I’ve ordered 15 Sonoff modules a few days ago :smiley: I’ll finally add a full tutorial here for everyone to follow easily while doing the flashing and setting up myself. Stay tuned.

3 Likes

Does anybody know how accurate power measurements and temperature / humidity measurement is?

And where will you place the SONOFF for Temp/Humidity measurement?

It´s much to big for “under the wall” (in german: Unterputz).

I don’t think any sensor is meant to be installed “Unterputz” or flush mounted :grinning:

Do you have a good idea to make a mounting with high waf (woman acceptance factor)? My wife will kill me if i will mount it onto the wall.

The SONOFF for energy measurement is not the problem, this can be placed behind the furniture, but the SONOFF TH for Temp/Humidity must be placed in good visible areas.

You need to be aware that if left on all the time, the ESP8266/Sonoff generates over 200mW of heat 70mA at 3v3) which means that the temperature sensor cannot be located close to or in the same small enclosure, otherwise you will get incorrect readings. If it’s a sensor only system then you might get away with using the sleep mode of the ESP8266 and wake it up every 10 minutes say, but that’s no good if you want to remotely activate the relay in the Sonoff.

This weekend, I installed a Sonoff to control my heating and wanted to keep the existing electronic thermostat as a backup and because it displays the temperature. This was initially in the lounge but was changed long ago to the hall by drilling a hole through the wall. The plastic cover over the old ‘hole’ is now convieniently covered by a picture.

The old hole now contains the Sonoff and a DHT22 sensor (connected to the spare pin on the 5 way connector) is inside the thermostat on the other side of the wall. The standard room thermostat cable in the UK is 4 wire (live, neutral, heating on and earth) so it was easy to power the Sonoff and connect the relay output in parallel with the existing thermostat.

Works well so far. The next job is to write a widget/rules to allow different temperatures for different times of the day.

1 Like

As far as I understand their webpage
https://www.itead.cc/sonoff-th.html.
you need to buy a separate sensor anyway … which should come with a cable. Unfortunately they don’t mention how long the cable is …