Giter Site home page Giter Site logo

Comments (56)

2016for avatar 2016for commented on May 26, 2024

from hass-sonoff-ewelink.

peterbuga avatar peterbuga commented on May 26, 2024

as @2016for mentioned above without the info provided with this script https://github.com/peterbuga/HASS-sonoff-ewelink/tree/master/sonoff-debug i cannot add support for any new devices.
let me know if you have problems with the script ;)

from hass-sonoff-ewelink.

seea2005 avatar seea2005 commented on May 26, 2024

https://paste.ubuntu.com/p/7Zpb5PT4DB/

from hass-sonoff-ewelink.

peterbuga avatar peterbuga commented on May 26, 2024

@seea2005 thanks for data. unfortunately i'm having a bit of a hard time linking this data to the requested values mentioned above: "open, close, stop and percentage if possible"

what i'm trying to say is that the dump looks exactly like a Sonoff Basic and you should be able to toggle it on & off right now.

any other information on how this device works might be of help, maybe even a screenshot from eWeLink app to see how it's displayed there.

from hass-sonoff-ewelink.

seea2005 avatar seea2005 commented on May 26, 2024

The device has three buttons, open, close and stop. When you install it, you have to close completely, and then open to let the device knows how many time the motor takes to open it completely, so it has a timer inside.

I think the device knows how opened or closed is by the time has happened, so just a number between 0 (opened) and 100 (closed) is needed maybe... don't know really...

The screenshot I attach is completely closed. I'll send a debug and another image half opened to let you see how it works.

Thanks for all!!

screenshot_20190120-210605 3338

from hass-sonoff-ewelink.

seea2005 avatar seea2005 commented on May 26, 2024

Maybe the parameter setclose on 0 as open, setclose on 100 as close, switch off as stop, and something like ewelink to set the position (setclose on 24, 32, 25...)

Partially opened
https://paste.ubuntu.com/p/zpFvr3bx6n/
half

Completely opened
https://paste.ubuntu.com/p/CxvqHwTp9R/
open

from hass-sonoff-ewelink.

peterbuga avatar peterbuga commented on May 26, 2024

i see it now, there's a new value in the dump "setclose": 100, and accordingly with the mentioned details above i think this might represent the state.
i do have one more question right now: does anything happens right now when you turn ON/OFF the switch in HA? do you get an OPEN / CLOSE buttons effect? meanwhile, i have really no idea what is the signal for STOP (button) πŸ˜… ... i'll probably figure it out eventually

from hass-sonoff-ewelink.

seea2005 avatar seea2005 commented on May 26, 2024

Maybe the parameter setclose on 0 as open, setclose on 100 as close, switch off as stop, and something like ewelink to set the position (setclose on 24, 32, 25...)

Right now ON means open till the end, and OFF close till the end.

Maybe something like that but mor simply, just up down stop and a scroll:
https://community.home-assistant.io/t/sonoff-dual-window-cover-with-set-position/50503

from hass-sonoff-ewelink.

seea2005 avatar seea2005 commented on May 26, 2024

This one is right opening
https://paste.ubuntu.com/p/NPk33xMNW7/

from hass-sonoff-ewelink.

seea2005 avatar seea2005 commented on May 26, 2024

And that one is closing
https://paste.ubuntu.com/p/BNQN2gKrCF/

from hass-sonoff-ewelink.

seea2005 avatar seea2005 commented on May 26, 2024

I think this works like I told before.

  • Open: setclose = 0
  • Close: setclose = 100
  • Stop: switch = Off
  • Partially: setclose = scroll?

Would be great a state function, a different icon for each state, one for setclose = 0, another for setclose=100 and another one for 0<setclose<100. 🀣

from hass-sonoff-ewelink.

peterbuga avatar peterbuga commented on May 26, 2024

I'm not sure it's just that easy (hint: from experience it never is πŸ˜…) but i'm sure there's some kind of combination between setclose + switch values. nevertheless we'll figure it out ;)

from hass-sonoff-ewelink.

seea2005 avatar seea2005 commented on May 26, 2024

I've checked it again and I agree with you, it isn't so easy. The order to open and close is just switch on and off respectively, set the target position with setclose, but the stop order is the hard thing, I can't see any way to send this order...

from hass-sonoff-ewelink.

2016for avatar 2016for commented on May 26, 2024

from hass-sonoff-ewelink.

seea2005 avatar seea2005 commented on May 26, 2024

I activated debugging mode (debug in logger), and I can't get any information about that as I just get the state, friendly_name and device_id by default. Is there any other change I have to do in my config to get this info?

from hass-sonoff-ewelink.

peterbuga avatar peterbuga commented on May 26, 2024

@2016for i never captured the websocket messages (but i'm thinking to do it in order to better integrate the Sonoff Bridge) the problem is that the broadcasted (received) messages might not always be the same as the ones that the app is sending and sort of throws me off a bit (i have to dig in the ewelink app code and hopefully reverse engineer what is getting sent)

@seea2005 right now there's no extra debugging to be done, as i mentioned above i might add new features. i never imagined i would go this far in integrating new devices so i skipped this part (mostly because it involves extra steps from 3rd party persons and i wasn't sure people were actually willing to help 😊)

from hass-sonoff-ewelink.

2016for avatar 2016for commented on May 26, 2024

from hass-sonoff-ewelink.

seea2005 avatar seea2005 commented on May 26, 2024

Good news! Don't know really how I got it, but I got this from sonoff-debug:

https://paste.ubuntu.com/p/ndHTm3M5fZ/

So:

  • Open: switch= on
  • Close: switch = off
  • Stop: switch = pause
  • Partially: setclose = scroll? + switch on/off depending if the new value is higher or lower maybe?

from hass-sonoff-ewelink.

seea2005 avatar seea2005 commented on May 26, 2024

Or better:

  • open_cover -> switch= on
  • close_cover -> switch = off
  • stop_cover -> switch = pause
  • position_template = setclose
  • set_cover_position -> scroll with setclose and maybe switch on/off depending if the new value is higher or lower?

from hass-sonoff-ewelink.

peterbuga avatar peterbuga commented on May 26, 2024

@seea2005 with all this info it starts to make some meaning πŸ‘

in the same time i added the advance(-r) option to log what is happening, here are the instructions:

  1. update the files from the new websocket-debug branch
  2. add a new option to the sonoff part in configuration.yaml -> debug: True
  3. (optional) change the scan_interval option to 10 or 20 sec
  4. (optional) it will be better if you could use a 2nd eWeLink account where'd you share only 1 device that you want to analyse (this way the log will be easier to read but i'll take anything otherwise) + you will be able to change stuff from inside eWeLink app with the original account and send better data to the log (otherwise the "grace period" kicks in)
  5. restart HA to start generating the log (on every restart the log gets cleared)
  6. leave it like 5-10 minutes running, turn on/off the device be it from HA or eWelink app, in the case of plugs with power meters (and alike) connect some devices to it too
  7. a new file sonoff_debug.log will be created in the root of your config folder (where there is also configuration.yaml, custom_components folder etc) save it and post it somewhere, DM to me or anything else. but please do not post the outputs here as it might be quite big!
  8. set option debug: False or just remove it & restart HA to get back to normal usage

one important thing to mention: most of the important data is still obfuscated and I cannot trace (or control) anything form my side (feel free to double check it) and also the the deviceid is NOT hidden anymore BUT instead it's an obfuscated-hash value because i need to know which-device-received-what if more of them are in the logs

@seea2005 in your particular device case it would be better if you could follow the 3. and 4. steps too. the more data the better for me πŸ˜„

from hass-sonoff-ewelink.

seea2005 avatar seea2005 commented on May 26, 2024

@peterbuga Thats what I get in the debug with the actions the device do from ewelink.

Close
2019-01-27 22:06:10.192 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "xxx", "params": {"switch": "off"}, "sequence": "1548623170126", "ts": 0, "userAgent": "app"}

Stop
2019-01-27 22:06:12.990 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "xxx", "params": {"switch": "pause"}, "sequence": "1548623172878", "ts": 0, "userAgent": "app"}

Open
2019-01-27 22:06:14.996 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "xxx", "params": {"switch": "on"}, "sequence": "1548623175038", "ts": 0, "userAgent": "app"}

Set Position
2019-01-27 22:13:58.802 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "xxx", "params": {"setclose": 75}, "sequence": "1548623638715", "ts": 0, "userAgent": "app"}

I don't post all the debug because it's so large... if you need anything else let me know

from hass-sonoff-ewelink.

peterbuga avatar peterbuga commented on May 26, 2024

@seea2005 that's really good! thanks for the output (to be frank the log file is huge because i was trying to capture the sensor states for another and see their data between websocket messages and poll-ing data, in the end more information never hurts πŸ˜…)

now that we know for sure there's a "pause" action, i just have to figure how to represent all these actions in HA (still learning it :D).
are you planning to control this device from HA frontend or just script-automate it?

from hass-sonoff-ewelink.

seea2005 avatar seea2005 commented on May 26, 2024

I'm planning to control it from HA, and do some scripts as well πŸ˜„

from hass-sonoff-ewelink.

seea2005 avatar seea2005 commented on May 26, 2024

Hi! Any news? Have you found anything about it?

from hass-sonoff-ewelink.

peterbuga avatar peterbuga commented on May 26, 2024

No new news :( didn't work on this component lately.

from hass-sonoff-ewelink.

seea2005 avatar seea2005 commented on May 26, 2024

Is there anything I can do to help you? I'll take a look to the code

from hass-sonoff-ewelink.

2016for avatar 2016for commented on May 26, 2024

from hass-sonoff-ewelink.

2016for avatar 2016for commented on May 26, 2024

from hass-sonoff-ewelink.

peterbuga avatar peterbuga commented on May 26, 2024

@2016for this idea cross my mind several times, but i have to (and God forgive me i hate to do it!) write documentation for it too πŸ˜¬πŸ˜… it's somehow easy for switch entities but things get a bit more complicated on other devices and i somehow prefer to implement it vs. explaining it (in case you didn't realise/noticed some people aren't even able to follow simple instructions of copy-pasting 3 files to install this component and this will just complicate things further, more questions etc 😩 for people looking to automate things further but have no idea what they are doing.)

from hass-sonoff-ewelink.

2016for avatar 2016for commented on May 26, 2024

from hass-sonoff-ewelink.

mclaudiopt avatar mclaudiopt commented on May 26, 2024

hi there.
i have this switch... i have entered the info on my file but it is still not detected...what can i do ? thanks a lot

from hass-sonoff-ewelink.

mclaudiopt avatar mclaudiopt commented on May 26, 2024

hi there. anyone was able to use this device ? with rest or mqtt?
thanks a lot

from hass-sonoff-ewelink.

Nitsan87 avatar Nitsan87 commented on May 26, 2024

Hi everyone,
Someone had a problem with the motor that after the first set, when i close the curtain and then open it again always the opening incresed in 20%...
after 5-6 full closing and opening the curtain not opened at all (until i set new switch registration).
Any ideas?

from hass-sonoff-ewelink.

mclaudiopt avatar mclaudiopt commented on May 26, 2024

hi...anyone was able to setup this swith on Homeassistant? thank you

from hass-sonoff-ewelink.

peterbuga avatar peterbuga commented on May 26, 2024

@Nitsan87 please edit your post (maybe describe the problem step by step) because personally I don't understand anything of it :|

@mclaudiopt this device has not been implemented yet, and i think it's kinda clear from this conversation. unfortunately i haven't got time to work around it, there's no ETA on it. if you're really anxious to implement this device there's always tasmota option ;)

from hass-sonoff-ewelink.

mclaudiopt avatar mclaudiopt commented on May 26, 2024

thanks for the reply..and with tasmota i will be able to control % of opening for example?
thanks

from hass-sonoff-ewelink.

peterbuga avatar peterbuga commented on May 26, 2024

i have no idea, i never tried tasmota myself. by default it exceeds the default capabilities of sonoff devices (but you lose the cloud connectivity!). also, i don't want to be a bummer but it's out of the scope of this thread/issue...

from hass-sonoff-ewelink.

mclaudiopt avatar mclaudiopt commented on May 26, 2024

hi peter...thanks for the reply....
and at least would it be possible to control this device via Homeassistant?

from hass-sonoff-ewelink.

mclaudiopt avatar mclaudiopt commented on May 26, 2024

Great new...King Kq courtain switch is working, but only with open/closed
is it possible to configure maybe as a dimmer so that percentage can be configured?

from hass-sonoff-ewelink.

mclaudiopt avatar mclaudiopt commented on May 26, 2024

Hello
can you please add Kingart- q4 to supported list?
with your code it is possible to open and close !

meanwhile, since with the physical switch and ewelink app is possible to "pause", in other words, to stop at any moment, can it be possible via Home assistant? how can i help implementing this feature?

from hass-sonoff-ewelink.

peterbuga avatar peterbuga commented on May 26, 2024

@mclaudiopt i appreciate your enthusiasm πŸ‘ but unfortunately if you're not a developer and willing to fork the code i'm not sure there's much you can do right now.
if you follow the thread the pause function can and will be implement, the best you can do after that is to be willing to test it. due to some personal problems i'm pausing the development right now and focusing on the everyday job, once i've had it sort out i'm gonna move forward again ;)

from hass-sonoff-ewelink.

mclaudiopt avatar mclaudiopt commented on May 26, 2024

ok thanks ! i will wait for the pause function !

from hass-sonoff-ewelink.

tiagofreire-pt avatar tiagofreire-pt commented on May 26, 2024

Hi, @peterbuga.

This would be an awesome add to your script. As the Tasmota firmware is not yet supported on this device, there is a hugely limited way to control properly this device otherwise using the official app.

I have this device already installed and willing to support you as beta tester.

Thanks and keep the good work!

from hass-sonoff-ewelink.

mclaudiopt avatar mclaudiopt commented on May 26, 2024

Hi there. i can also can be a beta tester...but Tiago i think it can be flashed with Tasmota....

from hass-sonoff-ewelink.

rlcobos2 avatar rlcobos2 commented on May 26, 2024

Hi, Anybody has advanced with this issue??

I have installed one in each window at home, and will be perfect if i can manage the positio with HA, ( google assistant allow to define the percentage desired to open ).

thanks in advance

from hass-sonoff-ewelink.

sergioa77 avatar sergioa77 commented on May 26, 2024

Hi, Any progress on this?
Thanks!

from hass-sonoff-ewelink.

fishbone-git avatar fishbone-git commented on May 26, 2024

closest I've seen: arendst/Tasmota#5059
not tested it personally, but considering it.

from hass-sonoff-ewelink.

elie-t avatar elie-t commented on May 26, 2024

Hi guys does anyone know how to make this king q4 remember his last state when electricity goes down and back again??

from hass-sonoff-ewelink.

peterbuga avatar peterbuga commented on May 26, 2024

Hi guys does anyone know how to make this king q4 remember his last state when electricity goes down and back again??

is this related to the functionality of this component? can you give more details?

from hass-sonoff-ewelink.

elie-t avatar elie-t commented on May 26, 2024

I mean when the electricity goes off and then on again if the curtains are open they will close automatically . While i need them to stay open. How can we do this

from hass-sonoff-ewelink.

fishbone-git avatar fishbone-git commented on May 26, 2024

It seems to be hard coded into the microcontroller firmware with no way to interfere from the esp device. I've even tried using a rule in esp home to trigger a stop command on boot, but it is ignored. Kingart says that it's configurable from the ewelink app, but that's not been the case for along time. This is why my Q4 is now earmarked for recycling or experiments only.

from hass-sonoff-ewelink.

romzysv avatar romzysv commented on May 26, 2024

Hi! Do you know if it is possible to set a different calibration timer for up and down? Because my roller shutter closes faster than it opens and so the calibration fail

from hass-sonoff-ewelink.

gminator avatar gminator commented on May 26, 2024

1548623175038

I'm getting the following response when I try to update the device state
{"error":504,"reason":"Request Timeout","deviceid":"xxxxxx","apikey":"xxxxxx","sequence":"159704507534"}

This is my request,
{"apikey": "xxxxx", "sequence": "159704507534", "ts": 0, "params": {"switch": "on"}, "deviceid": "xxxx", "action": "update", "userAgent": "app"}

I get the same results with setclose, not sure if has anything to do with the controlType param,

from hass-sonoff-ewelink.

gminator avatar gminator commented on May 26, 2024

Looks I was missing the sledonline param, it's not failing but it's still not opening the curtains
{u'switch': u'on', u'setclose': 0, u'sledOnline': u'on'}

from hass-sonoff-ewelink.

rlcobos2 avatar rlcobos2 commented on May 26, 2024

Hi, I have found this component . Works perfectly with kingart and all the sonoff products.

https://github.com/AlexxIT/SonoffLAN

from hass-sonoff-ewelink.

sergioa77 avatar sergioa77 commented on May 26, 2024

from hass-sonoff-ewelink.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.