Skip to content
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

SCB2 wifi switch #556

Closed
MichielioZ opened this issue Mar 15, 2021 · 9 comments
Closed

SCB2 wifi switch #556

MichielioZ opened this issue Mar 15, 2021 · 9 comments

Comments

@MichielioZ
Copy link

About a year ago got this wifi switch imported from America as Europe didn't have this "NoApp" version at the time...
As far as I can see it's just the MCB1 repackaged with "NoApp" support ?!
Maybe it already works ? Just thought I had to mention it is out there...
I didn't test anything as it is currently used by my parents with Google Home.
I have an spare one laying around here in case anyone needs testing...

scb2_front
scb2_back

@KTibow
Copy link
Contributor

KTibow commented Mar 15, 2021

NoApp just means that it sets up a network where you can enter your network credentials without needing an app. It could be that it did have it, but they didn't call it NoApp then.

@MichielioZ
Copy link
Author

MichielioZ commented Mar 15, 2021

@KTibow I specifically imported them because of the "NoApp" to make it easier for my parents to install it. So yeah, I know what it's for ;-) They just seem 100% the same (visually at least) to the MCB1, but if they identify under the new name SCB2 then this Python script won't recognize them unless you add the name and point to the MCB1 device for functionality. Currently I'm not using it with HA, but maybe somebody else (or me in the future) could use the new name being recognized...

@felipediel
Copy link
Collaborator

felipediel commented Mar 15, 2021

Hi @MichielioZ. Could you please discover this device so that we can add it?

import broadlink as blk

d = blk.discover()
print(d)

@MichielioZ
Copy link
Author

MichielioZ commented Mar 15, 2021

Not much information from discover:

[<device None None (0x6494) at 192.168.178.123:80 | c8:f7:42:75:b0:47 | 25748 | Locked>]

I unlocked it in the Broadlink app, unlocked it through d[0].set_lock(False), but it keeps showing up as locked...
Node-RED discover gives me:

typeid: "6494"
type: "Broadlink: Unconfigured Device Type: Log an issue with the device details and typeid returned as this may be a new device type."
name: "25748�E��E��c[;R���C���"

On a side note: apparently my Smart Bulb (LB27 R1) which previously showed up in discover now doesn't anymore... weird

Edit: It seems that discover only ever discovers 2 devices on my machine, is this normal ?

@felipediel
Copy link
Collaborator

I think we can control this device with the sp4b class. Let's do a test:

import broadlink as blk

d = blk.sp4b(('192.168.178.123', 80), 'c8f74275b047', 0x6494)
d.auth()
print(d.get_state())
d.set_power(True)
d.set_nightlight(True)
print(d.get_state())

@MichielioZ
Copy link
Author

get_state: {'pwr': 1, 'indicator': 1, 'maxworktime': 0, 'childlock': 0}
I can now turn the switch on and off with set_power.
set_nightlight obviously does nothing here (it's physically an MCB1 wifi switch)...

@felipediel
Copy link
Collaborator

Thank you! It works. I think it is reasonable to create a separate class to improve duck typing. I will do it.

@MichielioZ
Copy link
Author

@felipediel No, thank you ! This was resolved really fast :-)
I now edited my init.py so until next update of HA I can have a working switch (that I don't actually need, haha).
I am sure other people will thank you in the future for adding this and eventually I'm gonna use the switch...

@felipediel
Copy link
Collaborator

Thank you! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants