That’s good enough for me, I just wasn’t sure if it was doable. As it seems like it might be I’m happy to wait and see what happens. I have plenty of other HA-related things to be getting on with in the meantime, but will be available to test things if required.
Don’t know if this helps, but I had a look over the Amazon.co.uk’s reviews for the B25 and one (for the marsboy updated version - I don’t know what the updating involves) says they got it working on OpenHab as it appears as a Hue controllable device:
(small amounts of) SUCCESS! I’ve got a script working that can intercept commands from the switch, read the state from them, and send its own commands to change the state.
Its very rough at the moment, and I’ve only tested it with one S20c (could be differences between the S20c and the B25, and differences between devices). Its going to take a bit of work to package it up into something usable, but I’ll probably be looking for people to help test it in the next few weeks
Thanks for your great work. I tried it today with a B25 EU, but I couldn’t get it working. It seems like the encryption method could not decode the messages. Here is the log.
@Philipp1001 thanks for trying! I’ve been meaning to put out a proper call for testers for the last few weeks, but life has gotten away from me.
Can you try installing the master version from the github repo (pip install git+https://github.com/insertjokehere/homemate-bridge) then run the bridge with an extra --packet-log-file /tmp/logfile.json. This will log all packets in and out to /tmp/logfile.json, I would appreciate it if you can send it to me
Okay, I runned it with the master version from github repository. Now there is a different message. Here is the content from the logfile.json. When I run it multiple times, sometimes the output in logfile.json just contains (with whitespace as last char) [{“keys”: {“112”:
logfile.json (about a minute running) and the command line output.
Yes I think I was trying the PyPI Versions. Also I installed sometimes with pip3 instead of pip, but in this master pip3 didn’t create a file in /usr/local/bin, so I installed with pip and corrected the shebang to python3. Hopefully there are no side effects.
I’ve pushed a new commit to master that should fix the ‘KeyError’ thing (dumb bug, really should write some tests for this thing), might get you a little further. I’ll cut a new PyPI version once I’ve got things working for you
YEAAAHH! Great step forward! CLI Output and logfile.json. Its on and off state is logged in terminal.
The switch appears in Home Assistant. But it don’t work with state and function, but thats maybe some of my other config problems? I activated mqtt in HA with “mqtt: discovery: true”. The homemate-bridge argument is “–mqtt-host localhost”. In HA is an entity called “switch.homemate_switch_19216818849”. Did I miss something in the MQTT-Protocol?
If you see the homemate_switch_ entity in HomeAssistant then your MQTT config is probably correct. I don’t see a 'cmd': 15 entry (state change) in the log.
Does toggling the switch from the HomeAssistant interface work? If you manually toggle the switch with the physical button does the HomeAssistant interface update?
I can confirm that this code is working with an Orvibo B25 AUS. I have not tested it with Home Assistant but I can toggle the switch state by sending commands via MQTT using mosquitto_pub.
Thanks so much for all the work you’ve put into this @insertjokehere . It makes my B25 switches much more useful.
Toggling in HA doesn’t work. If I hit the button in HA, it toggles in HA interface but skips to its default after a few seconds (HA-Log: WARNING (MainThread) [hbmqtt.broker] 2 messages not broadcasted). No reaction in the homemate-bridge log and no reaction on B25.
If I hit the physical button, no reaction in HA (except in DEBUG Logs), but reaction in homemate-bridge.
Thanks for your feedfback jimb0. I will try it maybe later with mosquitto. And special thanks to insertjokehere for this awesome work and your help.
@hijinx: You don’t need an android device to extract PK. Just feed the Kepler.apk into the python script. The Kepler.apk is available for download with any device.
Hi guys. Is there any known way to get the device PK from iOS app? Or a non-android alternative?
I guess android simulatior may also be an option but no idea where to start…
Tx!
I just tested my B25 with the latest master version of homemate-bridge and Home Assistant, results as follows:
Works perfectly when using an external mqtt broker (mosquitto in this case). I am able to control the switch via HA without any issues.
Completely fails to work when using Home Assistant’s built-in hbmqtt.broker. Seems to be a mqtt protocol issue. None of my other mqtt devices (all using v3.1 protocol) could talk to HA’s built-in broker either.
I have a pair of Orvibo S20’s (early version configured using the WiWo iOS App) but I’m completely new to Home Assistant and looking at my options for my existing smart devices.
You say that they work fine with Home Assistant but could you explain for a newbie how you got them to show up and be detected on the system please?