peterbuga / HASS-sonoff-ewelink

Home Assistant component to control Sonoff/eWeLink devices with original firmware
MIT License
792 stars 294 forks source link

Sonoff RF Bridge integration #38

Open peterbuga opened 5 years ago

peterbuga commented 5 years ago

This dumps contain one single _Wireless Door Window Detector_

Open door detector

[
   {
      "__v":0,
      "_id":"[hidden]",
      "apikey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "brandName":"Sonoff",
      "createdAt":"xxxx-xx-xxxxx:xx:xx.xxx",
      "deviceStatus":"",
      "deviceUrl":"",
      "deviceid":"[hidden]",
      "devicekey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "extra":{
         "_id":"[hidden]",
         "extra":{
            "apmac":"xx:xx:xx:xx:xx:xx",
            "brandId":"58e5f344baeb368720e25469",
            "description":"WO1852",
            "mac":"xx:xx:xx:xx:xx:xx",
            "manufacturer":"\u6df1\u5733\u677e\u8bfa\u6280\u672f\u6709\u9650\u516c\u53f8",
            "model":"PSC-B67-GL",
            "modelInfo":"5a2e1ae50cf772f92c342ef6",
            "ui":"\u529f\u7387\u68c0\u6d4b\u63d2\u5ea7\u8fc7\u8f7d\u544a\u8b66",
            "uiid":32
         }
      },
      "group":"",
      "groups":[

      ],
      "ip":"[hidden]",
      "location":"",
      "name":"[hidden]",
      "offlineTime":"xxxx-xx-xxxxx:xx:xx.xxx",
      "online":true,
      "onlineTime":"xxxx-xx-xxxxx:xx:xx.xxx",
      "params":{
         "alarmCValue":[
            -1,
            -1
         ],
         "alarmPValue":[
            -1,
            -1
         ],
         "alarmType":"pcv",
         "alarmVValue":[
            -1,
            -1
         ],
         "controlType":8,
         "current":"0.16",
         "endTime":"",
         "fwVersion":"2.8.0",
         "hundredDaysKwh":"get",
         "init":1,
         "oneKwh":"get",
         "partnerApikey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
         "power":"21.90",
         "rssi":-60,
         "sledOnline":"on",
         "staMac":"xx:xx:xx:xx:xx:xx",
         "startTime":"xxxx-xx-xxxxx:xx:xx.xxx",
         "switch":"on",
         "timeZone":2,
         "voltage":"235.62"
      },
      "productModel":"Pow_R2",
      "settings":{
         "alarmNotify":1,
         "opsHistory":1,
         "opsNotify":0
      },
      "sharedTo":[

      ],
      "showBrand":true,
      "type":"10",
      "uiid":32
   },
   {
      "__v":0,
      "_id":"[hidden]",
      "apikey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "brandName":"Sonoff",
      "createdAt":"xxxx-xx-xxxxx:xx:xx.xxx",
      "deviceStatus":"",
      "deviceUrl":"",
      "deviceid":"[hidden]",
      "devicekey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "extra":{
         "_id":"[hidden]",
         "extra":{
            "apmac":"xx:xx:xx:xx:xx:xx",
            "brandId":"58e5f344baeb368720e25469",
            "description":"WO1851",
            "mac":"xx:xx:xx:xx:xx:xx",
            "manufacturer":"\u6df1\u5733\u677e\u8bfa\u6280\u672f\u6709\u9650\u516c\u53f8",
            "model":"PSF-BRA-GL",
            "modelInfo":"5a2e1b360cf772f92c342f01",
            "ui":"RFBridge",
            "uiid":28
         }
      },
      "group":"",
      "groups":[

      ],
      "ip":"[hidden]",
      "location":"",
      "name":"[hidden]",
      "offlineTime":"xxxx-xx-xxxxx:xx:xx.xxx",
      "online":true,
      "onlineTime":"xxxx-xx-xxxxx:xx:xx.xxx",
      "params":{
         "cmd":"trigger",
         "fwVersion":"2.7.0",
         "init":1,
         "rfChl":0,
         "rfList":[
            {
               "rfChl":0,
               "rfVal":"331801CC0582EE4D13"
            }
         ],
         "rfTrig0":"xxxx-xx-xxxxx:xx:xx.xxx",
         "rssi":-37,
         "sledOnline":"on",
         "timers":[

         ]
      },
      "productModel":"RF_Bridge",
      "settings":{
         "alarmNotify":1,
         "opsHistory":1,
         "opsNotify":0
      },
      "sharedTo":[

      ],
      "showBrand":true,
      "tags":{
         "disable_timers":[

         ],
         "zyx_info":[
            {
               "buttonName":[
                  {
                     "0":"Button Name1"
                  }
               ],
               "name":"[hidden]",
               "remote_type":"6"
            }
         ]
      },
      "type":"10",
      "uiid":28
   }
]

Closed door detector

[ { "__v": 0, "_id": "[hidden]" "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "brandName": "Sonoff", "createdAt": "xxxx-xx-xxxxx:xx:xx.xxx", "deviceStatus": "", "deviceUrl": "", "deviceid": "[hidden]" "devicekey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "extra": { "_id": "[hidden]" "extra": { "apmac": "xx:xx:xx:xx:xx:xx", "brandId": "58e5f344baeb368720e25469", "description": "WO1852", "mac": "xx:xx:xx:xx:xx:xx", "manufacturer": "\u6df1\u5733\u677e\u8bfa\u6280\u672f\u6709\u9650\u516c\u53f8", "model": "PSC-B67-GL", "modelInfo": "5a2e1ae50cf772f92c342ef6", "ui": "\u529f\u7387\u68c0\u6d4b\u63d2\u5ea7\u8fc7\u8f7d\u544a\u8b66", "uiid": 32 } }, "group": "", "groups": [], "ip": "[hidden]" "location": "", "name": "[hidden]", "offlineTime": "xxxx-xx-xxxxx:xx:xx.xxx", "online": true, "onlineTime": "xxxx-xx-xxxxx:xx:xx.xxx", "params": { "alarmCValue": [ -1, -1 ], "alarmPValue": [ -1, -1 ], "alarmType": "pcv", "alarmVValue": [ -1, -1 ], "controlType": 8, "current": "0.16", "endTime": "", "fwVersion": "2.8.0", "hundredDaysKwh": "get", "init": 1, "oneKwh": "get", "partnerApikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "power": "21.87", "rssi": -60, "sledOnline": "on", "staMac": "xx:xx:xx:xx:xx:xx", "startTime": "xxxx-xx-xxxxx:xx:xx.xxx", "switch": "on", "timeZone": 2, "voltage": "232.78" }, "productModel": "Pow_R2", "settings": { "alarmNotify": 1, "opsHistory": 1, "opsNotify": 0 }, "sharedTo": [], "showBrand": true, "type": "10", "uiid": 32 }, { "__v": 0, "_id": "[hidden]" "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "brandName": "Sonoff", "createdAt": "xxxx-xx-xxxxx:xx:xx.xxx", "deviceStatus": "", "deviceUrl": "", "deviceid": "[hidden]" "devicekey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "extra": { "_id": "[hidden]" "extra": { "apmac": "xx:xx:xx:xx:xx:xx", "brandId": "58e5f344baeb368720e25469", "description": "WO1851", "mac": "xx:xx:xx:xx:xx:xx", "manufacturer": "\u6df1\u5733\u677e\u8bfa\u6280\u672f\u6709\u9650\u516c\u53f8", "model": "PSF-BRA-GL", "modelInfo": "5a2e1b360cf772f92c342f01", "ui": "RFBridge", "uiid": 28 } }, "group": "", "groups": [], "ip": "[hidden]" "location": "", "name": "[hidden]", "offlineTime": "xxxx-xx-xxxxx:xx:xx.xxx", "online": true, "onlineTime": "xxxx-xx-xxxxx:xx:xx.xxx", "params": { "cmd": "trigger", "fwVersion": "2.7.0", "init": 1, "rfChl": 0, "rfList": [ { "rfChl": 0, "rfVal": "331801CC0582EE4D13" } ], "rfTrig0": "xxxx-xx-xxxxx:xx:xx.xxx", "rssi": -37, "sledOnline": "on", "timers": [] }, "productModel": "RF_Bridge", "settings": { "alarmNotify": 1, "opsHistory": 1, "opsNotify": 0 }, "sharedTo": [], "showBrand": true, "tags": { "disable_timers": [], "zyx_info": [ { "buttonName": [ { "0": "Button Name1" } ], "name": "[hidden]", "remote_type": "6" } ] }, "type": "10", "uiid": 28 } ] 
DenielTorres commented 5 years ago

Hi @peterbuga! Thanks for opening this "issue" as well. Let me know if I can help with this integration! I'm actually about to order a bunch of more from these sensors for all windows and doors at my home. Good luck!

peterbuga commented 5 years ago

@DenielTorres i've been watching this video https://www.youtube.com/watch?v=JP1X4wOjlTk and it turns out it might be a bit more tricky view the state of RF devices attached to the Sonoff RF Bridge, mostly because and RF device might change its ON/OFF state very fast and might not get picked up by the way the component works inside HA. Luckily I already have some ideas on how to achieve this, but this also sort-of implies that I might bug you for a while to do all kinds of tests. If you're up for it I'll do my best and start working on it πŸ˜‰

ps: I don't know if you knew this but turns out a Sonoff RF Bridge supports only 4 RF devices max! it's mentioned in the video and also here http://ewelink.coolkit.cc/?p=886 that's kinda of a small let down 😞 I thought I should let you know before you "order a bunch of more from these sensors for all windows and doors at my home"

max-rh commented 5 years ago

Hi @peterbuga , so sorry for the delay....and thanks for the updated debug script :). Here is the dumps, one for the RF_Bridge, and for the Bulb, and the third one is for my 2 Gang Generic Wall Switch, i know you did add support for 1 and 3 gangs, but this 2-gang shows up as 4 buttons on my HA, i think that the 3rd button is for an all channels on/off but i don't know whats the 4th one for,,,,

Happy to be of assists and thank a lot for your support Bulb.txt 2-Button.txt RF_Bridge.txt

peterbuga commented 5 years ago

@max-rh thanks for the requested data! looks like you have only 1 RF device attached to the Bridge, please let me know what kind it is: door / motion detector etc, i'll need to create some specific tests for RF devices because I believe they might react very fast between ON/OFF states, currently incompatible with master branch

regarding the 2-gang showing as 4, in eWeLink app there's 2 types of devices: single-switch devices and multi-switch devices. all the multi switch-devices have 4 "buttons", it doesn't matter if physically they are 2 or 3 :| the eWeLink app has thousands of devices lists to figure out what device has what, it's a real horror show wrapped in a spaghetti code which i'm not going to replicate! the websocket branch (which is awesome btw compared to the current master) tries to guess the number of switches and works ok in most of the cases, but it's currently not on par with latest master additions. i haven't made it the default one yet, because i expect a possible wave of complaints that i don't want to take care right now πŸ˜… also this branch is going to be the answer for the RF devices (hopefully 🀞)

max-rh commented 5 years ago

Great, one issue at a time. Thanks peter. Regarding the RF sensor, its a Door sensor, I do have couple of motion sensors to be integrated later, will update u with their dumps as soon as i do them. and i plan to get few other rf devices.

Regarding the ON/OFF state, i am not sure i get it. but i dont think the sensors react/send any data when u close it, it only sends an alarm when it opens.

peterbuga commented 5 years ago

I do have couple of motion sensors to be integrated later, will update u with their dumps as soon as i do them

i'm interested in a dump that has more RF devices attached to the sonoff bridge, to see exactly how they are laid out (i know my requests might sound a bit weird, but eWeLink coders or itead company or whomever makes this devices for some reason choose to add different logic for different devices and in some cases for different firmwares too. i tried to guess them them before with little data that i had but it has just a matter of time till someone threw me a bug πŸ˜“) please add a key fob (if you have one) i'm curious how this one is represented and how to ignore it, or maybe i'll add it too i don't know, i don't see a big usage to manually trigger HA actions or similar...to be seen.

Regarding the ON/OFF state, i am not sure i get it. but i dont think the sensors react/send any data when u close it, it only sends an alarm when it opens.

right now, with master branch, you get updates every 10-15sec or whatever you set up as scan_interval. a so called "alarm" is activated when (door gets open) a RF device goes from 0 to 1 (or maybe viceversa πŸ˜…) and silently changes its state back (when you close the door) or so i think, we'll figure it out in the end. if this changes happen between the defined scan_interval period they will not be picked up acting like nothing happened.

max-rh commented 5 years ago

Got it, Yeah i think your right, but its worth testing. Regarding the sensors, i installed the motion sensor, but sadly i don't have a key fob, here is what the dump looks like with the two sensors. (I am expecting couple more rf devices in the next few week). RF_Bridge.txt

peterbuga commented 5 years ago

I think I have what I need so far πŸ‘ I just need to find the time to crunch some code out of all this info. I'll let you know when I'll need some (inevitable) testing.

Thanks again for support!

aussiebyrd commented 5 years ago

Hi @peterbuga - in case another dump helps - here is mine. My Sonoff RF bridge is connected to two door sensors (Sonoff DW1), a DC fan (configured with three fan speeds and a fan-off option) and a DC fan with LED light (configured with light on/off, two fan speeds and a fan-off option). A mains-power Sonoff switch (S26 - AU version, already working in HA thanks to you) is also in the dump.

Let me know if I can help at all. SonoffRF_Bridge.txt

nzdazza commented 5 years ago

Hello @peterbuga, I am very keen to get the alarm triggers for the RF Bridge working too. From my perspective: Do care about receiving alarm triggers 4 triggers per device limit - awful, guess I'll just be buying a few...
Missing triggers < 10-15 sec apart, not worried. As long as the initial trigger is received I don't care about the "off". I am using cheap wireless PIR detectors which are picked up by the sonoff just fine

Happy to help in any way.

The out-of-the-box approach, despite the reliance on the cloud, is working very well for me so far. Love your work!

peterbuga commented 5 years ago

@nzdazza it'll be a cool nice/help if you generate a new debug log using the new extended method as defined in the current master branch. all you need to do is to read carefully the instructions on how to activate and generate the debug output (it's all mentioned in the project's description)

basically, after setting it up i need you to toggle on/off or change whatever settings you can related to Sonoff RF Bridge so that I can see what kind of messages are received over websocket. the previous approach gave me a "static" version of what is happening and I could only guess what I might be able to receive. ps: no worries if it's too hard or can't do it for whatever reason, i'll figure it out at some point πŸ˜‰

martusi61 commented 5 years ago

Dear Peter, in advance thank you for the work you are doing, then I wanted to know where you are with the integration of Sonoff RF, I have already bought 2 with some sensors and soon I will have to increase them. If you need help, debugging or anything else, I make myself available. Thanks again and good work.

FixxCZ commented 5 years ago

Just BTW for those who are not aware, there is a way how to use Sonoff bridge to translate any RF signal to MQTT. https://github.com/1technophile/OpenMQTTGateway/wiki/Sonoff-RFB I'm using it the way that door sensor and motion sensor via this gateway controling the light with Sonoff RF via MQTT and this custom component. And I have RF wall switch that is paired with Sonoff RF directly (using stock firmware). That means that automation controls turning off and on based on movement, timeout. But wall switch still ultimately control the relay and can override any other control.

martusi61 commented 5 years ago

Thanks FixxCZ, I already knew it, but I was interested in using Sonoff WITHOUT changing the original firmware, so I really appreciate Peter's work, thanks to him I already use about 20 Sonoff switches on HomeAssistant.

FreakyKiwi commented 5 years ago

Hi Peter, Thanks for the great work - I have successfully added several Sonoff switches to my new Home Assistant installation. I am using the Sonoff RF Bridge 433 in the opposite way to the issue here and am looking for support in HA. I am triggering the bridge via WiFi to send RF commands out to control my motorized projector screen.

The Bridge does not currently appear in HA at all although it is linked to the same account as my other power switches which do appear and work perfectly.

The Bridge supports four captured RF codes of which I am using three as per the log below (Down/Stop/Up)

Hopefully this can be supported and added to HA which will allow me to expose the switches via Hue emulation and include in my Harmony Hub config.

2019-06-22 06:52:53.901 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000665e0f", "params": {"cmd": "transmit", "rfChl": 0}, "sequence": "1561186372131", "tempRec": "1000665e0f", "ts": 0, "userAgent": "app"}

2019-06-22 06:52:56.248 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000665e0f", "params": {"cmd": "transmit", "rfChl": 1}, "sequence": "1561186374506", "tempRec": "1000665e0f", "ts": 0, "userAgent": "app"}

2019-06-22 06:52:58.261 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000665e0f", "params": {"cmd": "transmit", "rfChl": 2}, "sequence": "1561186376545", "tempRec": "1000665e0f", "ts": 0, "userAgent": "app"}

faisal-qureshi commented 5 years ago

The Bridge does not currently appear in HA at all although it is linked to the same account as my other power switches which do appear and work perfectly.

I have the same problem. I don't see my RF bridge, or the Sonoff Bulbs, in Home Assistant. Do I need to do something special for them to appear as sensors/switches, or something?

peterbuga commented 5 years ago

I have the same problem

it's not a problem, it's just not implemented. (otherwise this issue would not be open)

or the Sonoff Bulbs

there's another branch with support for sonoff bulb https://github.com/peterbuga/HASS-sonoff-ewelink/tree/sonoff-bulb also please take a look a the (pretty long) implementation of it and see what works and what doesn't https://github.com/peterbuga/HASS-sonoff-ewelink/issues/34 before asking/requesting further infos

FreakyKiwi commented 5 years ago

Thanks Peter, Do you have any plans to add support this device or should I look at flashing with Tasmota or using another supported RF transmitter?

Let me know if there’s anything I can do to help.

Matt

From: Peter Buga notifications@github.com Sent: Sunday, 23 June 2019 4:38 AM To: peterbuga/HASS-sonoff-ewelink HASS-sonoff-ewelink@noreply.github.com Cc: Matt Hamilton matt@thehamiltons.nz; Comment comment@noreply.github.com Subject: Re: [peterbuga/HASS-sonoff-ewelink] Sonoff RF Bridge integration (#38)

I have the same problem

it's not a problem, it's just not implemented. (otherwise this issue would not be open)

or the Sonoff Bulbs

there's another branch with support for sonoff bulb https://github.com/peterbuga/HASS-sonoff-ewelink/tree/sonoff-bulb also please take a look a the (pretty long) implementation of it and see what works and doesn't #34https://github.com/peterbuga/HASS-sonoff-ewelink/issues/34 before asking/requesting further infos

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/peterbuga/HASS-sonoff-ewelink/issues/38?email_source=notifications&email_token=AMNO6HPNDRTD4FXMZABNZJTP3ZINFA5CNFSM4GPHX4P2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYKM64Q#issuecomment-504680306, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMNO6HLOQ56QB2OJRKASI5LP3ZINFANCNFSM4GPHX4PQ.

peterbuga commented 5 years ago

@FreakyKiwi the plan was to add as many devices as possible but it's unbelievable hard to pseudo-blindly code when i don't have the device to test it and everything requires a tons of back & forth messages to see what i'm doing wrong, translated in time that I don't quite have it right now/anymore (also, it's summer right now and i just hate to stay inside and code πŸ˜…). in the case of sonoff bridge i think tasmota it's a better fit because you can attach many more rf devices to it vs. the original fw (unless itead changed something meanwhile, i'm not totally up to date) so it's entirely up to you.

i'll eventually add it, i just can't say when Β―\_(ツ)_/Β―

martusi61 commented 5 years ago

Peter, thank you for everything you've done so far, I'll follow your advice, for the Sonoff Bridge RF I'll use the Tasmota firmware.

ranski1999 commented 5 years ago

I have ewelink integrated on home assistant with original firmware and I have a RF Bridge and I cannot see it in home assistant with the door sensors I have Can someone help please

peterbuga commented 5 years ago

Can someone help please

@ranski1999 can you please read the thread?

ranski1999 commented 5 years ago

I did Thanks?

byxil commented 4 years ago

hello peterbuga, thanks for the work you've done. I'm also interested in using sensors without using the tasmota firmware. if you need help to do some tests, I'm available (byxil1 @ gmail.com), I have a presence sensor and door contact.

peterbuga commented 4 years ago

good news πŸ™Œ some generous people sent a small donation and i bought a RF Bridge + a sensor, not sure when they'll be shipped exactly (probably in < 1month Β―\_(ツ)_/Β―) but this will be a next device to be added πŸ‘

LiuVik commented 4 years ago

Hi Peter, thank you for yours good work. I have a question for you.... i used installation of your script in accordance with your manual, step by step. But, in HA i seen like results only relay swithches... my RF Bridge do not want to appear in dashboard or in devices in to the HA... Help me please... All actions in accordance with manual

peterbuga commented 4 years ago

@LiuVik this is going to sound mean but there’s a reason this issue still exists + only if you took 10sec to read the previous comment you’ll have your answer ... πŸ˜‘

peterbuga commented 4 years ago

hi anyone/everyone i just got my hands on a RF Bridge / remote / motion detector πŸ™Œ i'm looking forward to integrate this into HA in the feature, but i have a small logical problem: i don't know exactly how i should represent RF bridge connected devices into HA :(

for example, every time motion is detected just a short-timed feedback is sent via itead servers to the ewelink app which in turn triggers the alarm notification in the mobile app (and the scenes it contains as a trigger). i'm not familiar with any other alarm-like system in HA and/or how they behave and any input would be appreciated.

so far, the best i could come up is to represent each alarm-like device/ remote-buttons as a binary_sensor that would stay ON for like 1-5 seconds enough for the HA automations to capture and execute the rules based on it.

faisal-qureshi commented 4 years ago

Why even 5seconds?

An instantaneous high would trigger any script/automation

On Wed, Oct 30, 2019, 11:32 PM Peter Buga notifications@github.com wrote:

hi anyone/everyone i just got my hands on a RF Bridge / remote / motion detector πŸ™Œ i'm looking forward to integrate this into HA in the feature, but i have a small logical problem: i don't know exactly how i should represent RF bridge connected devices into HA :(

for example, every time motion is detected just a short-timed feedback is sent via itead servers to the ewelink app which in turn triggers the alarm notification in the mobile app (and the scenes it contains as a trigger). i'm not familiar with any other alarm-like system in HA and/or how they behave and any input would be appreciated.

so far, the best i could come up is to represent each alarm-like device/ remote-buttons as a binary_sensor that would stay ON for like 1-5 seconds enough for the HA automations to capture and execute the rules based on it.

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/peterbuga/HASS-sonoff-ewelink/issues/38?email_source=notifications&email_token=AA7RGU2CL3U2TNG6CD4BDLDQRHHNJA5CNFSM4GPHX4P2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECVKC6Y#issuecomment-548053371, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7RGU3G5N2Q3U2FCFOXPTLQRHHNJANCNFSM4GPHX4PQ .

peterbuga commented 4 years ago

@faisal-qureshi i never played with 'instant high' in HA automations so i'm not sure how well they'll behave. as far as i know HA checks every 1sec the entities status so I flip the binary_sensor ON/OFF in less than 1sec i'm afraid it'll be missed

faisal-qureshi commented 4 years ago

Oh shoot. You're right. I forgot that this is pulling statuses. In which case it could miss even on the 5 second.

This IS tricky.

On Thu, Oct 31, 2019, 3:40 PM Peter Buga notifications@github.com wrote:

@faisal-qureshi https://github.com/faisal-qureshi i never played with 'instant high' in HA automations so i'm not sure how well they'll behave. as far as i know HA checks every 1sec the entities status so I flip the binary_sensor ON/OFF in less than 1sec i'm afraid it'll be missed

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/peterbuga/HASS-sonoff-ewelink/issues/38?email_source=notifications&email_token=AA7RGU2TRTFDKATUHKM4BADQRKY27A5CNFSM4GPHX4P2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECXIUNA#issuecomment-548309556, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7RGU6ZD37Y67US46BB5LLQRKY27ANCNFSM4GPHX4PQ .

peterbuga commented 4 years ago

i've merge a bunch of new things in a new dev branch https://github.com/peterbuga/HASS-sonoff-ewelink/tree/dev and there's support for RF Bridge too

remote buttons act and they are displayed almost in same way code-wise, the only difference is that alarms are triggering well... alarm notifications. new binary_sensor entities will be created for each button/alarm connected to the RF Bridge and they'll automatically turn off after ~2sec, enough to trigger an automation

it's still in development so keep an eye on the log errors!

ranski1999 commented 4 years ago

Thanks I have been waiting for this great job.

peterbuga commented 4 years ago

@ranski1999 have you tried it yet?

ranski1999 commented 4 years ago

Yes it work well for sensors have not figured out plugs. I have 433 kHz plugs, they show up as binary sensors. On my phone if I open ewelink and home assistant together all of my sonoff devices go to unavailable about one minute after but if I open one at a time it works just fine. But overall it works great.

peterbuga commented 4 years ago

On my phone if I open ewelink and home assistant together all of my sonoff devices go to unavailable about one minute

you need to use the 2nd ewelink account & share devices to avoid this problem (if you already do this I do not know what is the problem right now πŸ˜“)

I have 433 kHz plugs, they show up as binary sensors.

when/if you have time could you please enable the debug mode of this component, follow the instructions and post the output. i personally have only RF Bridge + crappy remote control + motion detector. i don't have 433khz slampher/plugs/switch that can accept an RF signal and I don't know how they work exactly :| or for that matter how they are displayed in eWeLink app (alternatively if possible show me a phone screenshot of the bridge devices, might shed some light for me)

ranski1999 commented 4 years ago

Screenshot_20191104-045801

peterbuga commented 4 years ago

@ranski1999 i have to say i'm a bit confused about your setup exactly 😬 are the Plug N the physical plug switches or they are the buttons of a RF control remote? can you please link what exactly are the type/model of your plugs?

but more than that i think i need the dump of the debug to get the whole picture ...

martusi61 commented 4 years ago

Very good Peter, thank you for your great commitment to all of us, I then followed your advice and uploaded Tasmota to my bridge and discovered another planet! To be free, To be free, To be free!

ranski1999 commented 4 years ago

20191104_083525

20191104_083659

ranski1999 commented 4 years ago

developer

ranski1999 commented 4 years ago

Sorry with all the photos. Now how do I do debug mode. Is it in home asstants or in ewelink app.

ranski1999 commented 4 years ago

I made the 2nd ewelink account and shared like you said and I worked really good so far has been working for 1 hour.

peterbuga commented 4 years ago

@ranski1999 good and less-good news, i sort of figured out what kind of plug devices you have (the screenshot were good πŸ‘)

one last question before i draw my last conclusion, can you please let me know that you can toggle ON/OFF a plug from the eWeLink app? i don't have a device to receive a RF signal nor a feedback from app so i cannot tell it for sure :( basically i need to know if RF Bridge can also send RF signals out not just receive

ranski1999 commented 4 years ago

Yes you press the button on the left it turns on the plug. The button on the right turns it off. It is setup as a button device

ranski1999 commented 4 years ago

Screenshot_20191104-164738

ranski1999 commented 4 years ago

Here is a video that he sets it up. Go to 8:20 that were the 433 plug is. I hope this all helps you. I appreciate all of this that you are doing to make this work.πŸ‘

https://youtu.be/JP1X4wOjlTk

peterbuga commented 4 years ago

@ranski1999 ok ok i think i understand it now πŸ˜… i know some of my questions might sound a bit stupid but i'm kinda stuck in a corner sometimes trying to understand how they work - the RF Bridge basically replicates the remote rf buttons.

ranski1999 commented 4 years ago

That sounds really good if you need me to test something for you I will I'm just glad I'm able to help. I'm not complaining because this is awesome. I was wondering if there was a way that it could be changed. I used it for a couple days I think in home assistant it should say open or close not on or off. And remember I'm not complaining I could live with it

ranski1999 commented 4 years ago

Oh I forgot mine are on all doors and windows so I open them and close them not on and off thank you for your help