Hass.io Add-on: Sonoff Server / Sonoff no need of flash

i have many sonoff basic and doesn’t work, for now only work with sonoff touch us and sonoff t1 with 1,2,3 channels

delete sonoff.ha.json and sonoff.devices and config again

@gerswin. Thanks for the tip, unfortunately, it did not work. I deleted both files, as well as the config file, and started from scratch.

Now it just looks like nothing’s hapening:

sonoff.config.json looks like this:
image

sonoff.devices.json has been generated again but is empty.
sonoff.ha.json is not here anymore.

So, according to you, this addon doesn’t work with sonoff basic ? If so, I guess I should try flashing the device.

It will work with any of the known configurations off the sonOTA link. Basically you need to be able to POST setup commands to the device, I guess as they release updates or slightly different firmware builds for different devices, they close some of these vulnerabilities.

@mcinnes01 Understood. I’ll try to downgrade the firmware to a version that’s known to be working.
But I’m more and more enclined to flash the device, since I’m too dumb to fix the current issue.

I had no luck trying to downgrade the firmware, so I guess I’ll try flashing the device. there are quite a few method out there, have you guys already try one ?

Hi again,

@gerswin, with a get request, I managed to get the following information from my device:

{
“deviceid”: “1000409ae1”,
“apikey”: “f733c8e7-4898-487a-a8e6-62fb10287e48”,
“accept”: “post”
}

Can this be used in order to manually configure the device ? I’m stiil trying to find a solution to this situation.

Not really, I’d just try the post again, ensure you get your device in pairing mode, that you connect your laptop to it successfully, that you use the 10.10… ip address and that your post uses raw and you use the exact string I posted further up with your network/server details. Other than that, it’s likely a firmware issue. You could try using wireshark with the ewelink app maybe, but you’d probably have to see if there is a mobile version. Then see what commands the app is firing at the device. https://stackoverflow.com/questions/9555403/capturing-mobile-phone-traffic-on-wireshark

Hi @gerswin

I’ve update a couple of times recently and it seems like the sonoff server has lost all the devices, well it has the devices stored in it still, so as I reconnect each of my sonoffs, in your admin control panel for the sonoff server, they start displaying again with their names. However the sonoff.ha.json is empty again.

I’ve tried using the rebuild button, but this does nothing, the only thing that did anything was uninstalling and reinstalling the addon. This only partially worked then, in generated my sonoff.ha.json, immediately, but then after a couple of restarts two of my sonoffs hadn’t reconnected. I then restarted the sonoff server and the two sonoffs and they connected, but then my sonoff.ha.json was missing the json for the two devices that had disconnected.

I could control all my sonoffs through the server admin directly at this point, but not home assistant.

Is there any chance you can take a look at getting the repopulation of sonoff.ha.json to run on every restart and/or when you click rebuild?

Rebuild doesn’t seem to do anything as far as I can tell at the moment?

Currently, every time I restart home assistant, even if I manually update the sonoff.ha.json and can see all my devices in sonoff.devices.json, it wipes out all the devices associated with two of my sonoffs.

Many thanks

Andy

please make a bug report in https://github.com/gerswin/ihomeaddons

how many sonoff you have?
maybe is a sd problem.

I currently have 4x 4ch pro, but once I’ve finished my setup it should be around 16x 4ch pro’s and 50x pow r2

Any news on the Sonoff Basic?

Hello,

I do have the same issue. Installing the server worked like a charm. Log file also show sit came up without issues and is listening.

Sending the POST to the Sonoff switch also worked and returned error = 0. And it connects properly to the wifi router and gets its ip assigned.

However the switch doesn’t connect to the serve and isn’t listed on the webfront http://hassio.local:1080/.

in one of the posts above this article was linked: https://blog.ipsumdomus.com/sonoff-switch-complete-hack-without-firmware-upgrade-1b2d6632c01. There it says that the server needs to present some (can be bogus) SSL certificates for the switch to accept it as a cloud server. Can this be the problem? Is there a way how to fix that?

Andreas

Did some more investigation and captured the data traffic the switch sends. So it seems the POST command is able to configure the correct wifi, however the switch still tries to connect to an Amazon AWS server (52.28.157.61) :frowning:

So not sure what else can be done to try to make this work. I also tried to capture the traffic between my iPhone and the switch during the official configuration handshake but without success so far.

Hello, this is interesting, I wish I got it working. I have a (clone?) Sonoff Touch T1 (EU) bought from ebay now in december 2018, and as it seems hard to flash the firmware serially, I found this hass.io addon, and got halfway there.

In my case, I had major problems with the curl/wget POST syntax, and never really figured out why. But I still got that part fixed via a workaround (modifying the SonOTA python script, which actually seemed to get the POST command where it needed to go, unlike myself), to get the device configured properly; it is now at least on the correct SSID and I hope it is trying to connect the hass.io-IP on the correct port. My Sonoff still keeps blinking twice indicating that it just doesn’t reach the server. What is required for this primary server connection from the sonoff to recognize that it is connected?

I have yet not tried to catch what traffic actually is sent, as avrosen above seems to claim the problem is. If it really is trying to connect to a different IP, I guess a workaround might be to create a fake route in ones router, to redirect those attempts instead back into the LAN and make sure the hass.io-raspberry also accept this connection…?

I will still investigate this, and I believe many others will also be interested in the future. Let’s get this working, shall we?

1 Like

Hello. I would like to know if this supports the ifan02 controller. I have flashed 2 of them with tasmota and they worked fine for a while. After a few weeks, both of them completely quit working. I replaced them and am afraid to flash the new ones. Tasmota may have not had anything to do with it, but I don’t want to risk it. So I have everything on hassio except my ceiling fans. It would be great if I could use this for them.

1 Like

I’m trying to get this to work without luck. I can’t even get to “install” the addon.

I tried the following:

  1. Tried installing “Node Red Contrib Sonoff Server”

$ cd ~/.node-red
$ npm install node-red-contrib-sonoff-server

However, I don’t have the .node-red folder and even if I had, npm command not found so I believe I might be doing something wrong. I tried it using SSH

  1. Installing the “normal” addon. I added the URL to the community repositories but it wasn’t working either

I’ve had a lot of issues with this, created my own version of the sonoff-private-server and the version of this component (gerswin sonoff.py)

Sonoff Hass Component:


Sonoff server:

this is going to sound really stupid but I am a bit confused, I think I have read all the comments in this thread and got myself confused.

Can someone who has this up and running give me clues? My main issue is I have Hassio running on a PI which is connected to the network vie the ethernet rather than wifi. My laptop is windows 10. How do I then update my sonoff devices to use the private sonoff server? For reasons of my own I can’t flash the zonoff devices so this private server appears to be the only option for me I am being a bit slow here.

Thanks