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

I know this, but on the places i want to install the SONOFF TH, there is no place where i can hide it. The small sensor isn´t the problem. But my installed cases for flush mount are only 60mm deep - so SONOFF with a length of 90-100mm are a little bit to big.

That’s right and the cable can be as long as you like (to a certain extend at least). i’ve bought sensors with a cable of ~1m. @halloween if you really want to mount the module “Unterputz”, maybe you could loose the case? I still have to agree with @mikyh. Try to position the sensor as open as possible.

Probably worth reading:

You should reconsider to use something else then Sonoff if size is a problem. A Wemos D1 mini (pro) and a small Step Down Converter should easily fit into a flush mount and you can connect whichever sensor(s) you like. This is of course only something for tinkerers who know what they are doing (i.e. don’t play around with 230V)

Don’t know if this is of any use to anyone, but I just uploaded a youtube video of the process of flashing the Sonoff S20 with ESPEasy.

8 Likes

Another good video of how to hack Sonoff’s here:

4 Likes

I am newbie to almost everything, forgive me if I really asking something stupid,
I final flash to sonoff, and able to read MQTT from mossiquitto, also by command to to remote on/off,
now the problem is how to integrate to openHab, I have installed MQTT binding (loolks no gui to setup), In MQTT-Binding and some other Guide all mention openhab.cfg, problem is I don’t found it, is these the difference way on openhab to openhabian?

Please any expert may spend little time on me and let me know how to get it works?

openhab.cfg is the binding configuration file from openHAB1, which is splitted into individual binding config files in openHAB2. You will find more information about that in the docs:

http://docs.openhab.org/tutorials/migration.html#configure-add-ons

For MQTT: the config you have found for the MQTT part in openhab.cfg has to be transferred into mqtt.cfg (you have to create that file manually) and the prefix mqtt: has to be removed (as explained in the docs mentioned above).

Example:

openhab.cfg:
mqtt:mosquitto.url=tcp://localhost:1883

becomes
mqtt.cfg:
mosquitto.url=tcp://localhost:1883

assuming the broker you have setup is named mosquitto.
Be aware that because of [quote=“hamwong, post:48, topic:15024”]
I am newbie to almost everything
[/quote]
the MQTT binding is not the easiest to set up :slight_smile:

2 Likes

Install mqtt-action as well.

This is what my sonoff item looks like, I’m running arendst firmware.

Group   SonoffBedLight                  "Bedroom Night Stand"                                     (Sonoff)
Switch  SonoffBedLightSwitch            "Bedroom Night Stand" <light> (SonoffBedLight,HouseLight) { mqtt=">[mosquitto:cmnd/s20_1/power:command:ON:on],>[mosquitto:cmnd/s20_1/power:command:OFF:off],<[mosquitto:stat/s20_1/POWER:state:state:MAP(onoff.map)]" }

And onoff-map in transform:

0=off
1=on
ON=on
OFF=off

Regards, S

1 Like

Hey Seaside!
Are you on an older version of arendst’s firmware? The Transformation shouldn’t be needed anymore https://github.com/arendst/Sonoff-MQTT-OTA-Arduino/issues/46

1 Like

That’s what this issue is for, would you like to take it on? https://github.com/openhab/openhab-docs/issues/190

Do I have a choice now? :grinning:
Just kidding, sure, I will try my best, next spare time on my side is this weekend, stay tuned.

1 Like

thanks for helping me by sihui and seaside, so appreciate especially I see there is answer when I just wake up :joy:

so many thing to dig on openhab as I just found Karaf Console when I click into the page you refer, and found why some Guide have console command start with “openhab>”:joy: now I get it.

I got a stupid question, is it openhabian is totally same as openhab, all the file location and config storage is same as openhab standalone install pack? as I always get confused when I found Guide/demo on google, their store location can’t found in mine, I need to clarify due to OH version issue or due to openhabian

pls spare with my bad english :stuck_out_tongue:

I get sonoff works on “things” now, I able to get it show in Homekit and control (just not getting status, don’t know why yet), I want to know does MQTT items need to create “Things” like “Wemo Siwtch” first? or set it up in sitemap?
currently I still not able to get control under OH2, only through homekit. to OH2 itmes and get linked

@ThomDietrich
Nice! Will change my config and remove the map.
Regards s

No, MQTT is a 1.x Binding. Only 2.x Bindings create things and channels.
For configuration of the MQTT binding strictly follow:

Yes, there is no difference between an openHAB2 version in openHABian and an openHAB2 version installed through apt-get or manually.
openHABian has in addition to that a lot of features and config options available if you are not familiar with setting up a Linux based operating system together with openHAB2 on a Raspberry Pi platform.

I get sonoff works, with status on homekit although I don’t know how I actually make it work.
Thanks for all the support, really helps and save me lot of time.

(post withdrawn by author, will be automatically deleted in 96 hours unless flagged)

PR #247 created

Is mqtt the only way to communicate with a sonoff device in openhab or is there another firmware where i don´t need mqtt? Maybe controll with http-binding?

arendst firmware works flawlessly with MQTT binding
Please feel free to share your problems :wink:

There probably is but MQTT is really the best option to consider here. MQTT is an amazing piece in the IoT puzzle. Are you afraid to add yet another component to your home automation system?