-
Notifications
You must be signed in to change notification settings - Fork 421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New device: Sonoff B02 #269
Comments
I already found out that I can control the device using the sonoff_sendcommand: I am now trying to hack this, but since I never programmed in Python, I did not succeed yet. |
I already fixed it myself (kind of). This code works for me now (first time Python for me, so it can be improved): `
` |
Can this be added into the existing code at some point? |
Yes. Sorry. All my latest time on other project. |
I have also been working at this, it looks like the FS-1 and the B02 bulb are actually the same bulb. |
I am not sure which device the FS-1 is (which brand)? But anyhow, your code seems to work fine (even better than my code) for my Sonoff B02, thanks a lot! |
I think that the FortuneShip FS-1 is actually the same bulb as the Sonoff B02. Here is the info from .sonoff.json file: { |
tomlevels |
I just tested, everything works except for the effects (if I select them nothing happens). Maybe that's because I do not know how to configure the effects. The effect does go to custom when I manually change something, so that works. |
Excelent work @thomasadelhardt! Just got a "Smart Cloud QMS-2C-CW" bulb from Aliexpress. Looks to be the same as the Sonoff: I have added your modifications, and it comes up as a bulb in home assistant, but I got a few issues with it:
Here is my .sonoff.json file: |
For some reason the effect settings are specified in my sonoff.json, my code read these and stores them, so they can be assigned to the bulb when a effect is selected. |
Thank you. |
I have tried to edit the code in my pull request, but not sure how it works, but here is the new code with hard coded values for the effects:
|
Sorry no my configuration.yaml file only has: I have just tried to add mode:cloud but that doesn’t change the behavior. I have one more of these bulbs, new in the box. |
Okay.
|
adding debug... |
Okay so I added debug. Very handy! Also I added the other bulb, funny enough that worked with bluetooth, I couldn't get that working with the other bulb. I created a new ewelink account using another email address, and shared the bulb's with that account. Debug log from HASS start up, and turning the bulb on: |
That looks like it is some of my old code, could you try the updated code at: |
You have to have 2 different users/accounts registered at ewelink. In the app log out of your main account. (Profile -> Picture of gear -> Log out) sonoff: |
That's exactly what I did. Just realised my HASS is at 0.116.4, so working on upgrading that. Thank you so much for all your help 👍 😊 |
Thanks a lot. Unfortunately I can't get it to work, get this error in the log:
|
I have updated the code, hopefully it works now. |
Thank you Thomas, I updated with HACS, 43eecdd it says so I guess that is right. All I ever see in the debug log is: This is me turning the bulb on, so I guess the integration receives an "off" right after turning it on |
Just realised that turning the bulbs on in the eWeLink app is in fact correctly reflected in HASS. Here is the log lines when turning on in the eWe app: |
I found out I wasn't sending scene/effects commands to the bulb as it where supposed to be done. |
Wheeee!!! Thank you so much. I owe you one! 👍 |
Nice to hear. |
sounds god. |
sorry had to rollback your latest commit on my HASS @thomasadelhardt (47af237) since it broke my bulb's again. |
I will merge when I have time. Sorry |
Yup it is a limit in the bulb.
Sorry to hear that, I thought I had nailed it! Could you try if this branch/patch works?
|
Ohh very interesting with local control! Unfortunately the newest version is stil problematic. First I ran in to a problem about "No module named 'asyncio.exceptions'", which I found (here: https://github.com/AlexxIT/XiaomiGateway3/issues/58 was related to me still running Python 3.7.
So now it loads. |
Okay, so the right commands are sent to the bulb, but the bulbs state is not reported back to HA.. What does your log say? |
Is B02 works fine in latest release? |
You can reopen issue if it's still relevant |
Here the dump for a new device (dump contains 2 instances): Sonoff B02. I can use it as a switch or light, but I cannot control the brightness or color.
[
{
"__v": 0,
"_id": "[hidden]",
"apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"brandLogoUrl": "https://eu-ota.coolkit.cc/logo/q62PevoglDNmwUJ9oPE7kRrpt1nL1CoA.png",
"brandName": "SONOFF",
"createdAt": "xxxx-xx-xxxxx:xx:xx.xxx",
"devConfig": {},
"devGroups": [],
"deviceUrl": "",
"deviceid": "[hidden]",
"devicekey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"extra": {
"id": "[hidden]",
"extra": {
"apmac": "xx:xx:xx:xx:xx:xx",
"brandId": "5c4c1aee3a7d24c7100be054",
"description": "20200806001",
"mac": "xx:xx:xx:xx:xx:xx",
"manufacturer": "\u6df1\u5733\u677e\u8bfa\u6280\u672f\u6709\u9650\u516c\u53f8",
"model": "WTW-SNL-02",
"modelInfo": "5e7a146548af4f7140874c8e",
"ui": "\u53cc\u8272\u51b7\u6696\u706f\u652f\u6301\u968f\u8c03\u53ca\u573a\u666f",
"uiid": 103
}
},
"family": {
"id": "5ea32db98011010008ceba36",
"index": 0
},
"group": "",
"groups": [],
"ip": "[hidden]",
"location": "",
"name": "[hidden]",,
"offlineTime": "xxxx-xx-xxxxx:xx:xx.xxx",
"online": true,
"onlineTime": "xxxx-xx-xxxxx:xx:xx.xxx",
"params": {
"OTA": "success",
"bindInfos": {
"gaction": [
"57727a4d-330d-4e21-8656-4b0328b42dfd_ewelinkGoogleHome"
]
},
"fwVersion": "1.3.1",
"ltype": "white",
"selfApikey": "",
"sequence": "123456789",
"switch": "on",
"version": 7,
"white": {
"br": 12,
"ct": 105
}
},
"productModel": "B02",
"settings": {
"alarmNotify": 1,
"appDoorbellNotify": 1,
"opsHistory": 1,
"opsNotify": 0,
"wxAlarmNotify": 0,
"wxDoorbellNotify": 0,
"wxOpsNotify": 0
},
"shareUsersInfo": [],
"sharedTo": [],
"showBrand": true,
"type": "10",
"uiid": 103
},
{
"__v": 0,
"_id": "[hidden]",
"apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"brandLogoUrl": "https://eu-ota.coolkit.cc/logo/q62PevoglDNmwUJ9oPE7kRrpt1nL1CoA.png",
"brandName": "SONOFF",
"createdAt": "xxxx-xx-xxxxx:xx:xx.xxx",
"devConfig": {},
"devGroups": [],
"deviceUrl": "",
"deviceid": "[hidden]",
"devicekey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"extra": {
"id": "[hidden]",
"extra": {
"apmac": "xx:xx:xx:xx:xx:xx",
"brandId": "5c4c1aee3a7d24c7100be054",
"description": "20200806001",
"mac": "xx:xx:xx:xx:xx:xx",
"manufacturer": "\u6df1\u5733\u677e\u8bfa\u6280\u672f\u6709\u9650\u516c\u53f8",
"model": "WTW-SNL-02",
"modelInfo": "5e7a146548af4f7140874c8e",
"ui": "\u53cc\u8272\u51b7\u6696\u706f\u652f\u6301\u968f\u8c03\u53ca\u573a\u666f",
"uiid": 103
}
},
"family": {
"id": "5ea32db98011010008ceba36",
"index": -1
},
"group": "",
"groups": [],
"ip": "[hidden]",
"location": "",
"name": "[hidden]",,
"offlineTime": "xxxx-xx-xxxxx:xx:xx.xxx",
"online": true,
"onlineTime": "xxxx-xx-xxxxx:xx:xx.xxx",
"params": {
"OTA": "success",
"bindInfos": {
"gaction": [
"57727a4d-330d-4e21-8656-4b0328b42dfd_ewelinkGoogleHome"
]
},
"fwVersion": "1.3.1",
"ltype": "white",
"selfApikey": "",
"sequence": "123456789",
"switch": "on",
"version": 7,
"white": {
"br": 34,
"ct": 85
}
},
"productModel": "B02",
"settings": {
"alarmNotify": 1,
"appDoorbellNotify": 1,
"opsHistory": 1,
"opsNotify": 0,
"wxAlarmNotify": 0,
"wxDoorbellNotify": 0,
"wxOpsNotify": 0
},
"shareUsersInfo": [],
"sharedTo": [],
"showBrand": true,
"type": "10",
"uiid": 103
}
]
The text was updated successfully, but these errors were encountered: