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

That absolutely works! Great, thanks so much for your support here, Jerome

1 Like

You’re welcome. :slight_smile:

Interesting video on Sonoff factory from SuperHouseTV ( Jon Oxer )

3 Likes

I wish he had asked them why they still haven’t added terminals to allow us to wire in external switches…

Great video indeed!

Hello!

I was wondering if anyone used Sonoff B1 light bulbs? Is it possible to install Tasmota firmware on them, and, if it’s possible, is it possible to do so using SonOTA (without hardware modifications and soldering)? I’m looking for a RGB LED E27 light bulb that’s controllable via OpenHAB.

Best regards,
Davor

I do not but yes, many discussed it and you’ll also find a few comments in this thread. The B1 is easiest flashed with SonOTA.

You should be aware that the Sonoff B1 isn’t the best product on the market though. Check out AILight: http://tinkerman.cat/sonoff-b1-lights-and-shades/

Hello @ThomDietrich

Thank you for your insight. What do you mean by “isn’t the best product”? From the review you’ve linked, and if I understood it correctly, the only way to flash AiLight is by soldering connectors (and I’m really bad at soldering stuff). Are there any other LED RGB Bulbs, which could be used with OpenHAB, but without soldering? And what is a downside of B1? Is it a shadow of the antenna (it shouldn’t be a problem for me, since the bulb would be inside a desk lamp, therefore, not directly visible)? I will use it mostly for the mood light, so, light brightness shouldn’t be a problem either. Anyways, thank you for your help once again.

Best regards,
Davor

Brightness and color seem to be downsides (remember: I do no own a B1). From what you wrote the B1 might indeed be your better option.

Philips Hue, Milight, Ikea Trafri… :slight_smile:

1 Like

Hello!

Thank you for all the information. I will take it all into consideration before making a purchase.

Best regards,
Davor

Hi,
I also run into the trap with the cheap “SONOFF” Switch which is no SONOFF. Leason learned.

Now I’ll order here (I’m from Germany)
https://creationx.de/

This YouTube video posted a few days ago might be useful for many.

I’m looking forward to finally using my three sonoff basics I bought almost two years ago. This thread and OTA firmware will hopefully be just what I needed to push me over the edge. I just ordered two 4ch pros (one with RF) and the new s31 (U.S.). The 4ch pro with RF I hope to use for my 3 garage doors. The s31 I plan to use to monitor washing machine.

Can anyone comment on my two concerns:
Am I taking much of a risk with fixed 433 RF for garage doors? What is the likelihood that someone can open my garage doors?
How safe is it connecting these devices to main (120v U.S.)? I may be paranoid but I don’t want to risk any fires.

Thank you,
B34N

Why not order directly from https://www.itead.cc it is much cheaper, but it takes a while to deliver.

have problem to switch my sonoff. via console its ok, can switch with:

[17:43:34] openhabian@openHABianPi:~$ mosquitto_pub -h localhost -t "cmnd/sonoff/POWER" -m ON
[17:44:46] openhabian@openHABianPi:~$ mosquitto_pub -h localhost -t "cmnd/sonoff/POWER" -m OFF

works.
but not in openHAB, try diffent items, but no will run, e.g.

Switch Sonoff_CH1 "Innenlicht" <light> (WZ,gLight) ["Lighting"] { mqtt=">[mosquitto:cmnd/sonoff/POWER:command:*:default], <[mosquitto:stat/sonoff/POWER:state:default]" }

mosquitto run:

2017-12-29 16:00:56.474 [INFO ] [penhab.io.transport.mqtt.MqttService] - MQTT Service initialization completed.

2017-12-29 16:00:56.481 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'mosquitto'

any idea whats wrong here?

Can someone recommend a good case for the Sonoffs? I’m looking at these right now: https://www.banggood.com/SONOFF-IP66-Waterproof-Junction-Box-Waterproof-Case-Water-resistant-Shell-p-1223669.html?rmmds=buy&cur_warehouse=CN

That is up to you to decide how much risk you are willing to take on. Using wifi you can certainly make it much more secure using things like MQTT with client certs and the like, but do you need to? How paranoid are you? If I were in a high crime area I would probably want to use something a little harder to spoof. But in a low crime area I wouldn’t see it as too much of a problem. But I have insurance and no known motivated enemies. My rick profile could be very different.

If they are motivated and have the time and hardware (e.g. SDR) 100% guarantee that they can open your garage. Even a brute force device might work. But you would have to be a target of sufficient worth to spend the time and money on the devices. I would do some research though to see how generic garage door remotes work and make sure your’s works differently somehow or else you become vulnerable to any garage door opener hack.

The thing you have to pay attention to is the AMPs. For example, does your washing machine draw more than 16 amps? Because that is the max that the S31 can support and you will start fires if you try to run more amps through it than it supports. There used to be some problems with Sonoffs overheating but I think the new ones have made improvements to the manufacturing process and they now have UL certification so should be reasonably safe, as long as you don’t try to overload them.

Today we flashed 3 x 4ch and a sonoff touch with sonOTA and i have asked myself why the hell i didn’t try this before.
We could flash 4 devices faster than soldering Pins on them would have taken.

It is really worth a try, if you didn’t try it yet. :slight_smile:
And as @rlkoshak already mentioned somewhere, we should point that out explicitly here.

Hey @ThomDietrich (and all interested in updating your tasmota flashed sonoff devices out of openHAB)

I had some spare time and have configured fw upgrades according to https://github.com/arendst/Sonoff-Tasmota/wiki/openHAB#maintenance-actions

But i thought it would also be nice to have not only the installed firmware per device,
but also the current available online release as an direct indicator.

Fortunately GitHub offers a great API for stuff like this and i have expanded the wiki solution in the following way:

http.cfg

# Tasmota Release Status (cached twice a day)
tasmotaRelease.url=https://api.github.com/repos/arendst/Sonoff-Tasmota/tags
tasmotaRelease.updateInterval=43200000

sonoff.items

String Sonoff_Action "Sonoff Action" <sonoff_basic> (Sonoff_Maintenance)
String Sonoff_Current_FW_Available "Current Release [%s]" <sonoff_basic> (Sonoff_Maintenance) { http="<[tasmotaRelease:10000:JSONPATH($[0].name)]"}

Switch  Sonoff_Wohnzimmertisch_LWT "Status Wohnzimmertisch" <sonoff_basic> (Sonoff_Maintenance) { mqtt="<[ohBroker:tele/sonoff_wohnzimmertisch/LWT:state:MAP(reachable.map)]" }
String Sonoff_Wohnzimmertisch_FW "Firmware Wohnzimmertisch [%s]" <sonoff_basic> (Sonoff_Maintenance) { mqtt="<[ohBroker:stat/sonoff_wohnzimmertisch/STATUS2:state:JSONPATH($.StatusFWR.Version)"}

Switch  Sonoff_Subwoofer_LWT "Status Subwoofer" <sonoff_basic> (Sonoff_Maintenance) { mqtt="<[ohBroker:tele/sonoff_subwoofer/LWT:state:MAP(reachable.map)]" }
String Sonoff_Subwoofer_FW "Firmware Subwoofer [%s]" <sonoff_basic> (Sonoff_Maintenance) { mqtt="<[ohBroker:stat/sonoff_subwoofer/STATUS2:state:JSONPATH($.StatusFWR.Version)"}

Switch  Sonoff_Wohnzimmerwand_LWT "Status Wohnzimmerwand" <sonoff_basic> (Sonoff_Maintenance) { mqtt="<[ohBroker:tele/sonoff_wohnzimmerwand/LWT:state:MAP(reachable.map)]" }
String Sonoff_Wohnzimmerwand_FW "Firmware Wohnzimmerwand [%s]" <sonoff_basic> (Sonoff_Maintenance) { mqtt="<[ohBroker:stat/sonoff_wohnzimmerwand/STATUS2:state:JSONPATH($.StatusFWR.Version)"}
val sonoff_device_ids = newArrayList(
    "sonoff_wohnzimmertisch",
    ...
    "sonoff_subwoofer"
)

rule "Update Sonoff Status"
when
    Time cron "0 0 0 ? * * *" // Update once a day
then
    for (String device_id : sonoff_device_ids) {

        logInfo("sonoff.rules", "Updating FW Item for Device: " + device_id )
        publish("ohBroker", "cmnd/" + device_id + "/STATUS", "2")

    }
end

This grabs the device firmware once a day or on query from the switch item.
It also grabs the latest existing tag from the tasmota github repo, so you can directly get an information about the current available firmware.

As far as i know the github api doesn’t need an authentication for public available repos and the data should be reachable for everyone.

8 Likes

I am trying to upload code to my sonoff pow device using the Arduino IDE. When compiling I get this error:

exit status 1
#error "MQTT_MAX_PACKET_SIZE is too small in libraries/PubSubClient/src/PubSubClient.h, increase it to at least 512"

No idea what is wrong here as it just throws an error if sth. went wrong. Any idea?

Go to the Arduino pubsubclient.h file.

It’s located somewhere like Arduino\Libraries\PubSubClient\src\pubsubclient.h.

Open the file using notepad or another file editor.

Change the packet size line to:

#define MQTT_MAX_PACKET_SIZE 512

Save and re-compile.