Sonoff-HomeAssistant (Alternative firmware for Sonoff Switches for use with mqtt/HA)

Thanks, I look more for energy metering then on off

Will check the Github site over the weekend for your new POW code.
Not suggesting I’m keen but have been peeking every now and then, haha.

Well it’s been going now for a good week. Seems fairly stable. I guess time will tell as soon as more people start using it :smiley:

Stay tuned …

OK Github has been updated. Any issues with new code, please let me know. Thanks

can you point a guide?

can you give a link for the adapter, thanks

I guess I need to buy an “FTDI adaptor” and “USB HUB” … but which?

s there anything that avoids soldering?

Well you’ll need to solder the header pins to the board.

A normal ftdi adapter will work. Ftdi is used to converts usb to ttl so you can connect sonoff to your pc usb port.

I did not solder at all. I build myself a connector, one side with a pin header and another to the ftdi adapter. Then insert the pin header into the holes on the sonoff board and hold it in place while flashing it. Works perfectly. Will send some photo once i have a chance

2 Likes

this I am missing. Can you send me a link of a product to buy (ebay/amazon)?

Just search in amazon. I’m not sure if everything works but i’m using Waveshare
https://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=WaveShare+FT232

For pin headers, just search those up in amazon or google…
https://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=pin+header&rh=i%3Aaps%2Ck%3Apin+header

and some wire pin connector

I can’t see your searches. I see tons of connectors and tons of headers, tons of pins, I just don’t know which are the good ones

They’re just wires and connectors. Don’t think too much. You just need one that works. Just watch some videos if you’re not sure how to connect.

yes, but I need to order it. I haven’t at home

just download the code but not working, having error compling

This time I really need help. with a proto-board I’ve let the sonoff work with both Wall Switch on RX pin and DHT22 on GPIO14, mqtt can update the relay status and receive updates from wall switch

BUT

when I use my Z-Wave remote controller to low-down my curtains, the switch on the sonoff will turn on ad off accordingly the curtains movements… turns on when curtain moving, off when i stop it.
Seems there’s no updates from MQTT because i’m listening on the topic with my pc… what’s this? what’s happens?

Sorry my bad. Just checked here and it seems I forgot one line. Please add

#include "power.h"

after the includes in the code so should look like this

#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include <Ticker.h>
#include "power.h"

Thanks for pointing it out. Will fix the code on Github.

Without looking at how you have physically modified your Sonoff, I’d say the chances are very high the cable you’re using between the wall switch and the Sonoff is acting like a crude antenna picking up RF and the ESP just sees that RF as a high signal. Try using a pulldown resistor on the pin of say 10K? You’ll need to experiment with the value.

Post a photo. I’v gotta see this :smiley:

ok, the problem seems the wall switch circuit. I’ve used a scheme like this:

https://postimg.org/image/s3f34gvab/

but with 1KOhm from 5 to input-pin (instead 10K) and 330Ohm from input-pin to signal (alarm relay, instead 1KOhm). These changes because the capacitor takes long time to discarge and put input-pin to low signal.

In some way this circuit is capturing z-wave interferences and switches the input-pin state.
What can i do?

What the hell is Alarm Relay?

Please go to Github again. I saw another small error that I corrected. It’s all working now !!!

Tested it on the fridge :smiley:

My plan is to now install an ESP based Temp sensor in the fridge and see if I can control the power vs temperature to maximize $$$$