If I look at the startup messages in home assistant, I see:
Timer got out of sync. Resetting
21:38 core.py (ERROR)
Setup of tts is taking over 10 seconds.
21:38 bootstrap.py (WARNING)
When targeting Google Home, listening port has to be port 80
21:38 components/emulated_hue/__init__.py (WARNING)
Listen IP address not specified, auto-detected address is 192.168.192.79
21:38 components/emulated_hue/__init__.py (WARNING)
Setup of sensor is taking over 10 seconds.
21:37 bootstrap.py (WARNING)
Setup of mqtt is taking over 10 seconds.
21:37 bootstrap.py (WARNING)
When I click the switch toggle on the main states page, the toggle moves for a second and the reverts. Nothing happens with the switch.
I can control the switch directly through the tasmota web interface.
It looks to me like the sonoff is communicating via topics ha/sonoff/LWT, ha/sonoff/cmnd/POWER and ha/sonoff/STATE
and HA is communicating on topics cmnd/sonoff/POWER and stat/sonoff/POWER so they are basically not talking to each other on the same topics.
Hi All, as promised i would get back to you with my results of the retry.
It works like a charm! Tried the new firmware first: no success, Resoldered the headers for the sonoff, just to be sure: Check! So: shame on me, it looks like it was my lack of solid soldering skills that seemed to be the reason. Thanks for your help anyway!
I am using 7 different versions of Sonoff switches with a total of 20 ckts. working in my Home Assistant system running on a RP3 Raspbian Stretch Desktop using Mosquitto MQTT server.
These have all been flashed with https://github.com/arendst/Sonoff-Tasmota/tree/development/sonoff developed by Theo Arends. This firmware works great and also his github describes in detail how to flash his firmware onto the Sonoff switches also you don’t have to solder anything, just hold the 4 pin connector in the 4 holes on the board while you are doing the flash.
The only issue I have encountered is failure of two of the S20 Smart Sockets. With a bit of trouble shooting I determined that the only part of the unit that failed was the AC to DC bridge rectifier. With a few modifications and the addition of a Gikfun FT232RL 3.3V 5.5V FTDI USB to TTL Serial Adapter Module for Arduino Mini Port set at 5.5V, I have a HA controllable dry contact which I have placed in series with a remote garage thermostat which is controlled by a automation in HA using the output from a http://sonoff.itead.cc/en/products/sonoff/sonoff-th to determine the temp in my remote garage, also flashed with Theo Arends firmware.
My opinion on the firmware is why reinvent the wheel when you already have a perfect wheel?
Why reinvent the wheel? Because sometimes (read a lot of times) people overcomplicate a simple task. I am a minimalist and designed the firmware accordingly. The only issues with this firmware is generally to do with the individual who is trying to install it and mistakes that they make. Because of it’s minimalistic approach, it’s bulletproof and has been running on switches that I have had for 2 years without any intervention. That’s why… but thanks for your opinion. It’s duly noted
Actually it wasn’t that I was making some kind of “mistake”.
The firmware wouldn’t work properly with the wall switch under some (common, IMHO) conditions.
After modifying the “retain” statement to false I no longer have ANY issues with flickering using the wall switch function. I still may find in the future I might need to add a filter circuit but for now my setup is working pretty good.
So I guess I was wrong…It was your firmware after all and, therefore, not completely “bulletproof”. That’s why I & others have been adding solutions to the problems we have been having.
But I still like it better than the others I’ve tried because of its simplicity. And I thank you for putting it out there for everyone to use.
However, you need to learn to take a little constructive criticism.
I’m not sure why you you’ve been triggered and taking this personally because I wasn’t referring to you. However, I am glad you like it and figured out the exact setup for your situation. Sorry that I didn’t give you specific instructions for your particular setup and helped you more but I do this in my spare time for the betterment of the community as a whole and it’s hard to work out individual situations especially when I’m not there. You’re saying you changed a firmware option and it’s working? That’s great to hear. Part of doing what you are doing is called learning. That’s why you built your own system vs buying a ready made solution. The stability of the firmware though once installed and working is like I said bulletproof, mainly because of it’s simplicity. Again, most issues have to do with the installer and the fact that they are learning on the job. Enjoy HA, it’s an amazing system and it’s all free. By all means if you discover a runtime bug in the firmware that I am unaware if, please feel free to post in here or in the Github page and I can have a look at it. Cheers
I honestly didn’t think you were talking specifically about me.
It was a pretty general statement about others “mistakes” and that it wasn’t your firmware at fault at all. I was just pointing out the probable overstatement of those facts.
By posting this for peoples benefit you kind of take on the mantle of “expert”. When something doesn’t go as expected people will look to you for help. It is your firmware after all.
“user definable” is kind of broad. Everything in the firmware is “user definable”.
I put my own wall switch functionality in your original Sonoff basic firmware that diudn’t originally include it. But yours now includes it and it is equivalent to the code I have in mine.
They “kind of” worked. Apparently there was either interference on the wall switch wiring and/or the signaling from the wifi was being interrupted and causing occasional relay chatter. That is until I put in those LED bulbs then they just were literally not functional until I set the “retain” to false. Now they work (tentatively) perfect.
However, the simplicity of the firmware was a positive in allowing me to figure out what it was “supposed” to do and modify it to finally be able to get it to work. Along with a lot of suggestions by others on this thread.
Actually I had omitted the code from the switch for the very reason you mention, it wasn’t an accident it was deliberate. Let me explain a little.
The power supply in the Sonoff is a switch mode supply. Inherently they aren’t the most clean form of DC but with a few filter caps on the DC side they get the job done. They are under rather than over designed. Because they’re not fully isolated any noise on the AC side can produce spikes on the DC side because little filter capacitors just aren’t big enough. They were only really deigned for clean AC coming in not dirty.
LEDS are notorious for noise because their supplies aren’t designed to be clean at all. All they’re doing is just powering an LED so it’s not very important as say a logic circuit.
If a device like the Sonoff is on the same circuit (sometimes not even) that noise can travel down the mains and find it’s way into the Sonoff supply which does a shit job off isolating it. That noise is appears across the whole circuit board because it’s not isolated and is just dropped down AC being rectified into DC. The end result is what you are seeing. Add an extra long cable that acts as a form of crude antenna connected straight to a low level logic pin and there you have it, low level logic with spikes throughout the whole supply rails being misread as logic level changes. There are NO filters on the Sonoff because quite frankly it really is misusing the pin for something unintended.
Now why the original Sonoff is less tolerant to noise than the TH series is anyones guess but probably because of better board layout or just luck. That and the fact that it’s quite difficult to connect into the little pins right in the middle of the Sonoff original board made me decide to leave the switch logic out of the original Sonoff. You then went back into the code and put it back in without really taking any of that into account. Now I understand, in your specific environment, the retain option didn’t help but you are using the old firmware version where it was not user configurable or not easily at least. That is not there case in the latest version.
Speaking of criticism, you modified the code and just added back what was essentially missing and available in the other versions of my code, how can you criticise it? Had you written a smart software debounce routine that catches transient spikes that somehow help with the situation I would understand totally, but if you had, why not share it with everyone else considering as you say this is a major oversight in the code.
Anyway enjoy the switches. Glad they’re working for you.
I didn’t say it was " a major oversight in the code".
I didn’t criticize the wall switch code functionality in and of itself. The code works fine to allow a wall switch to function to turn on & off the relay.
Yes, I added it back in not taking into account that the original Sonoff is more susceptible to AC noise. I didn’t know that it was when I did.
I didn’t write any “debounce” code so there was nothing to share.
I’ve pretty much posted EVERY SINGLE THING I’ve had any issues with and tried to post EVERY SINGLE THING I’ve found/done to successfully overcome those issues in hopes that my experiences might help somebody else having the same issues.
If those posts helped anybody then that’s great, if not then just ignore them.
Obviously it’s your choice and I respect that but would it not be better to make it optional with those warnings upfront and just point people to them if they don’t bother to read them and have problems as it only occurs in a few specific circumstances.
I say this because the most popular use for new Sonoff Basic users on here at the moment is being able use original light switches and you’re instantly making the use of your firmware not an option. I run five like this using Tasmota with up to 8” wires to the switch and no issues whatsoever.
Kman
I am following your experiences with sonoff
sorry about your equipment
I wanted to ask what if a basic switch sits in happily in the wall as you put it
is there any concerns about security
can it melt,
does it has some protection
power cut anything to prevent short circuit and fire
When trying to flash the sonoff I am getting the error msg “no matching function for call to 'PubSubClient::PubSubClient(WiFiClient&, const char [12], int)”
Is this because of the pubsub file issue that danichispa brought up?
Do I need to replace my pubsub with a different version, I’m not sure I understand.
I have saved the pubsub from your instructions and renamed the folder PubSubClientKmanOZ and in the sketch have included the following line instead of the usual PubSub. #include <PubSubClientKmanOZ.h>
It doesn’t work and tells me “Invalid library found” etc.etc.
I feel like I’m struggling to understand a relatively basic concept here… any help or direction would be much appreciated
Hi actually i have faced the issue you have described i had two switches connected to LED lights stopped working in the last week, is there an isolator or some electrical device i can add to protect the sonoffs kindly guide