-
Notifications
You must be signed in to change notification settings - Fork 44
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
SwitchBot Contact Sensor Counters #283
Conversation
Waiting for verification with device … @evlo @masfernandez any chance you can test and verify this on an ESP32 with OpenMQTTGateway with your SwitchBot Contact Sensor? Thanks |
SwitchBot Contact Sensor activity counters added
@DigiH Why you in hurry? the code is unfinished. I still have to decode PIR and HALL information, but I'm not having much time. I will let you know when it's done properly. Regards, |
Not in a hurry, but was more directed at evlo who mentioend that he wanted to have the ability to register the push button on contact sensor, so getting this functionality into the next release of Decoder would be nice. PIR and HALL should already be fully implemented in the current version of the decoder, unless it is not working properly for you. |
Do i need to build the development branch and flash it using serial or is there some easier way? Update: I think I understand now - gateway and theengs are different theengs. |
I can kick off a test build run, which you can then upload through the web install page. Still needs your ESP32 being hooked up to the PC though. Would that work for you? Alternatively you could build and upload the development branch and just change the decoder URL in platformio.ini from |
If you could just attach bin that I can flash onto esp32 dev board that would be easiest for me. |
I'll start off test builds, with bins and web upload available then - takes about an hour to run … updating here when they are ready |
The test binary can be installed through the web upload at Please chose the Or the direct binary download at After the upload to your ESP32 please follow the initial WiFi and MQTT credential set-up |
open close and few presses
PIR:
|
Thanks a lot @evlo, The This will also propagate into the Theengs Gateway HA add-on |
i know this is not the correct place to post this, but for PIR if |
Let me quickly double check this decoding … I followed the official SwitchBot API so for your PIR case above But that doesn't mean that in the offical API there couldn't be a typo, if you think it should be different for you. Do the remaining Byte[5} settings correspond with what is set for your PIR?
|
yes, |
but you have set the LED state to ON in the preferences, so it is showing wrong, following the documentation, and should likely be reversed, right? Could you just do a quick test by setting LED to OFF in the SwitchBot app and see what is decoded then? |
yes, that is what I was just trying out :)
I even tried triggering motion so the led does turn on, it does, but it still just returns false (or in the graph it says raw value 0 all the time) Also if i set indicator light to off in switchbot app, LED does not turn on when motion is detected |
Then I am wondering if they might have swapped the IOT (which is not currently included in the decoder) and LED state in the documentation. Could you post the MQTT output with all the data again please for both LED state ON and OFF, so that it will be apparent in the data which bit is actually the LED state? |
on
off
|
now that is weird, as the supposed LED bit - Byte[5] - bit[5] - did not change with the LED settings change, with the whole Byte[5]Bit[7-4] being 0 in both cases. Could well be because of an incorrect documentation, or some firmware glitch in the encoding - I assume you have the latest firmware on your PIR? |
I do.
so alt least 3 bytes did change |
So unless it might take a while before the LED settings change is being included in the advertised servicedata I think it can only be a erroneous documentation or advertising encoding fault.
Again, according to the documentation this octet and the preceding one should be part of the
So I would assume this time part would be different with every single braodcast received. |
So wonderlabs are actually doing the communication differently then what is advertised? |
As a last test, would you mind also changing the settings for sensingdistance and shine a bright light on it for the Light intensity? |
|
This part is only available by connecting and reading, not in the scope of Decoder, but still possible with OpenMQTTGateway with the READ command. |
So everything else looks fine, just the LED settings state is not correctly advertised, at least not according to the documentation. Thanks for pointing this out! It will need further investigation and communication from SwitchBot to see what the issue is. |
I think it is quite minor thing, but I do not know how other use this thing, personally if switchbot would make option for remote advertise key presses would be much more (even monetarily :D ) appreciated by me then fixing the led status. |
I have seen the issue you logged about it, and I know of others contacted them about it, so hopefully this will be implemented with a future firmware update - and is then also being documented correctly ;) Thanks again for your verification of the Contact Sensor Counters here. |
SwitchBot Contact Sensor activity counters added
Checklist: