Sonoff /eWeLink component for original firmware

I just went back to git to have another look, I hadn’t noticed the difference in folder structure between the websocket branch (the branch I’ve been on) and websocket-HA0.88+. Likely because I was on 0.87 when I installed the component. So yes, I did read the readme- but it was the readme for the branch that I had installed at the time; I didn’t notice the difference in the newer one until now (likely since I wasn’t using the new version at the time of installing the component and had since forgotten about it being there), but yes, the instructions are very simple. Thanks for getting me to have another look at it, and notice the newer branch; even if it was an extremely condescending way of doing it.

@peterbuga I saw you have updated on github yesterday. I have websocket for +0.88HA. Wich version should I update now? I see that only init.py is updated, so update only this file? Thanks for great work! I hated flashing sonoffs

@warcanoid now that (mostly) everyone figured it out the global HA0.88+ components structure change, i’m moving towards exclusive support for it too, therefore i released/archived the old versions (if someone might ever need them)

right now master holds again the latest stable (i hope!) changes (websocket branch will be removed soon too) everything got merged into it and gone are the polling days, websocket all the way :muscle: (as general knowledge i’m still using polling of data as a fallback to update the states and sensors)

if you have only switch devices you can easily avoid update the component, not much has changed in that area and probably nothing will drastically change anytime soon. instead there’s a new advance-r and dumb-er built-in system to generate sonoff debug logs that i desperately need them and it seemed to be a real problem for most of the people to provide them :frowning:

ps: next device integration is Sonoff B1 with full brightness/colour settings if anyone’s interested and willing to test

Hey, i have a quick question.
Been using the component for a while and its great, especially with the websocket version which works great with the interlocking feature of the 4ch, it’s wonderful.

My case in question:
I want to use a sonoff 4ch to control the irrigation system in a remote location.
I have checked that the timers still fire even if the sonoff is disconnected from the wifi/internet (at least the ones i set during the day, i am guessing that the daily repeating ones will still work in the case there’s no wifi- feedback welcome on this)
Although the tasmota fw does serve this purpose I feel safer using the default app and fw to set my irrigation timers.
What i would like to do is have a remote hassio instance collect weather data and then enable or disable the timers set on the sonoff by its app (assuming ofcourse, that there is a link established)

TLDR: I would like to be able to enable/disable timers set on the device by eWeLink. Is this possible (or would it ever be in the future)?

Thanks in advance and again, congrats :slight_smile:

Note: i was just going through your github readme looking this up and i saw the tip about having a second ewelink account and sharing the switches. That’s a life saver too, just did it :slight_smile:

@krash to quickly answer your main question, in one way or another, anything that can be done with the mobile app can also be done by this component … the only problem is how much work needs to be done to “translate” the mobile API to HA integration :sweat_smile: (i’m saying this because i have the feeling that the API was created by countless minds, the rules keep changing from section to section like it’s the result of some :spaghetti:-code)

your request is somehow particular and i would appreciate if we could continue this discussion in a github issue because i can quickly think of a few things that can easily extend the logic for this feature, like how do you represent the timers? do you turn off all per device or just a specific one? and so on.

in the same time i can also say that i will not add this option anytime soon so it’s up to you if you want to continue with this or not. right now i’m dedicated to integrate all the devices people throw at me and add extra features later (hope you understand)

Totally understandable.
I will start a github issue to propose my thoughts just for the good house-keeping of the project.

Just to clear things up, i was talking about Schedules and not Timers (was just confused with the tasmota terminology) and i am referring to the master switch of each schedule as a first implementation step.

Like in my case, for my 4 irrigation zones, i can set 4 On and 4 Off schedules (8 in total). I would like to be able to control their master switches remotely from HA (so i can do it automatically depending on weather data). If i had that remote control access, i could also set different sets of on/off switches and enable/disable the different sets depending on how long i want it to water the garden.

I should add here, in case someone is interested in an irrigation project, that i just installed a sonoff 4ch to controll my home irrigation using this wonderful code by @klogg but my needs on this project were different and it depends on hassio to run the on/off and not on internal eWeLink scheduling. Klogg’s code is set up with tasmota devices but it’s easily usable with @peterbuga’s component too. (gimme a shoutout for help, i just went through it)

Good to hear that it is possible and that one day it might be implemented.
Thanks again.

Github Issue opened, hope i did everything correctly :slight_smile:

hey peter i want to use this component for cover integration in home assistant. i’ve just created a cover template in home assistant all is good but when i expose it in google home and i ask to google home to close or open cover, google says me ok i will close/open twio devices but nothing happen. Why?

@Hdjweb let’s take it step by step:

  • does the cover works in HA by itself? meaning can you toggle it successfully without any templating/automation/etc? if not, then most likely it’s not supported yet. please go to project’s page and read carefully the debug section and how (to open a new issue for it and) to provide the useful data i need in order to complete the integration
  • if you can use the cover in HA just fine, than it’s probably another type of problem outside the scope of this thread and it’ll be better (reached) if you open another thread about it

@krash all perfect and nicely done! you’ll be notified when i start working on it :wink:

1 Like

Ok yes in home assistant covers go well I have not automation i have only open close and stop cover. They are simply. I hope to solve it thank you for all

@Peterbuga there is a problem in home assistant log i have this error with Home assistant 0.91.2

Log Details (ERROR)

Tue Apr 09 2019 10:03:39 GMT+0200 (Ora legale dell’Europa centrale)

error from callback bound method Sonoff.on_message of custom_components.sonoff.Sonoff object at 0x69a63cd0 ‘NoneType’ object has no attribute ‘attributes’. How can I solvei think it will be something about component

if you updated to the last version of component please take a look at the (new-ish) entity_prefix config option, better said:

i hope that might fix it, otherwise feel free to open an issue and post the debug log also mentioned as a new feature in the project’s description

Ok I removed prefix and now it goes good I hope the will put as official component. It will be a beautiful things. Thank you peterbuga

fw 3.0.0 for sonof basic and th10 and ch4r2pro OK successfull

thanks! added to the list :wink:

1 Like

Ok I will continue my request here for the Chacon devices. The appz for this device is different (play store: chacon home)… so no more eWeLink based …
I know you already did a huge work to integrate most of the sonoff devices … but maybe you can fork this project and work on the chacon conponent for HASS. I know you probably don’t have this device… if you are in europe, I can send one to you.

Why not buy something that is open, like the Shelly.

Well … because I already got 4 of these devices, they are older than shelly’s… In another hand I ordered a shelly 2.5 for my testing… I hope to received in a couple of days (2 batch order). In the worst case, I will have buy 3 other Shelly to swap my chacon devices.

I assume you mean shelly.

Yes Shelly 2.5 sorry.

For the Chacon’s devices… (popular here in west europe), there was an attempt to make a Jdoom module: https://www.jeedom.com/forum/viewtopic.php?t=23435
Not a lot of informations inside the first msg… but can be a hit.
To be honest, I am completly new in Home assistant… so it will take me a couple of days/weeks/months… to start to have a global view. But I already managed to install HASS and the eWeLink integration within 1h :slight_smile: