Broadlink binding for RMx, A1, SPx and MP. Any interest?


(Dario) #633
==> /var/log/openhab2/openhab.log <==
2018-12-01 16:53:28.745 [WARN ] [.discovery.BroadlinkDiscoveryService] - BroadlinkDiscoveryService - Beginning Broadlink device scan                                         ...
2018-12-01 16:53:28.773 [WARN ] [.discovery.BroadlinkDiscoveryService] - BroadlinkDiscoveryService - Broadlink device scan waiting for 10 seconds to complete ...
2018-12-01 16:53:28.902 [INFO ] [.discovery.BroadlinkDiscoveryService] - Data received during Broadlink device discovery: from 192.1.68.1.21:80[34:ea:34:42:f1:f1]
2018-12-01 16:53:28.909 [DEBUG] [.discovery.BroadlinkDiscoveryService] - Adding new Broadlink device on 192.168.1.21 with mac '34:ea:34:42:f1:f1' to Smarthome inbox
2018-12-01 16:53:38.778 [WARN ] [.discovery.BroadlinkDiscoveryService] - BroadlinkDiscoveryService - 10 second wait complete ...
2018-12-01 16:53:38.783 [WARN ] [.discovery.BroadlinkDiscoveryService] - BroadlinkDiscoveryService - Ended Broadlink device scan...
2018-12-01 16:53:38.788 [INFO ] [link.internal.socket.BroadlinkSocket] - Socket closed

This is what i get from my unsuccesful discoveries

What stands out to me is that Broadlink device discovery: from 192.1.68.1.21:80[34:ea:34:42:f1:f1] would make sense for an mqtt enabled device, however if you scroll up to my nmon scans ( #597 ) , this broadlink device doesn’t have that port open. That doesn’t change if i restart it. purely out of testing completeness: i can try doing the binding having the bridge app open, but even that app didnt’ feel like was funcioning (any command sent to it through it’s “api” wouldn’t work).
Have they created a local connection-proof variant?


Edit:
XD the thing went online adding it manually using the IV and key provided by X-ray in #592
O.O :star_struck:
that’s a total surprise to me XD - i love such surprises.

2018-12-01 17:19:33.626 [DEBUG] [nk.handler.BroadlinkBaseThingHandler] - broadlink:rm3:d310766a: initialization complete
2018-12-01 17:19:33.338 [hingStatusInfoChangedEvent] - 'broadlink:rm3:d310766a' changed from UNINITIALIZED to INITIALIZING
2018-12-01 17:19:33.405 [me.event.ThingUpdatedEvent] - Thing 'broadlink:rm3:d310766a' has been updated.
2018-12-01 17:19:33.415 [me.event.ThingUpdatedEvent] - Thing 'broadlink:rm3:d310766a' has been updated.
2018-12-01 17:19:33.606 [me.event.ThingUpdatedEvent] - Thing 'broadlink:rm3:d310766a' has been updated.
2018-12-01 17:19:33.617 [me.event.ThingUpdatedEvent] - Thing 'broadlink:rm3:d310766a' has been updated.
2018-12-01 17:19:33.628 [hingStatusInfoChangedEvent] - 'broadlink:rm3:d310766a' changed from INITIALIZING to ONLINE
2018-12-01 17:19:34.632 [TRACE] [nk.handler.BroadlinkBaseThingHandler] - broadlink:rm3:d310766a: updateItemStatus; checking host availability at 192.168.1.21
2018-12-01 17:20:05.046 [TRACE] [nk.handler.BroadlinkBaseThingHandler] - broadlink:rm3:d310766a: updateItemStatus; checking host availability at 192.168.1.21
2018-12-01 17:20:35.057 [TRACE] [nk.handler.BroadlinkBaseThingHandler] - broadlink:rm3:d310766a: updateItemStatus; checking host availability at 192.168.1.21
2018-12-01 17:21:05.067 [TRACE] [nk.handler.BroadlinkBaseThingHandler] - broadlink:rm3:d310766a: updateItemStatus; checking host availability at 192.168.1.21
2018-12-01 17:21:35.076 [TRACE] [nk.handler.BroadlinkBaseThingHandler] - broadlink:rm3:d310766a: updateItemStatus; checking host availability at 192.168.1.21
2018-12-01 17:22:05.085 [TRACE] [nk.handler.BroadlinkBaseThingHandler] - broadlink:rm3:d310766a: updateItemStatus; checking host availability at 192.168.1.21
2018-12-01 17:22:35.094 [TRACE] [nk.handler.BroadlinkBaseThingHandler] - broadlink:rm3:d310766a: updateItemStatus; checking host availability at 192.168.1.21
2018-12-01 17:23:05.103 [TRACE] [nk.handler.BroadlinkBaseThingHandler] - broadlink:rm3:d310766a: updateItemStatus; checking host availability at 192.168.1.21
2018-12-01 17:23:35.116 [TRACE] [nk.handler.BroadlinkBaseThingHandler] - broadlink:rm3:d310766a: updateItemStatus; checking host availability at 192.168.1.21
2018-12-01 17:24:05.129 [TRACE] [nk.handler.BroadlinkBaseThingHandler] - broadlink:rm3:d310766a: updateItemStatus; checking host availability at 192.168.1.21
2018-12-01 17:24:35.141 [TRACE] [nk.handler.BroadlinkBaseThingHandler] - broadlink:rm3:d310766a: updateItemStatus; checking host availability at 192.168.1.21

i’ll have to study the remaining part of the guides now XD


(Dario) #634

update & questions

  • I haven’t gotten around the broadlink bridge to work. it just doesn’t detect my device i think.

  • In the instructions in the box of the rm pro + iwas directed to an app called ihc for EU by broadlink, all of the data was so far managed with that.

  • i’ve tried using this one https://sourceforge.net/projects/broadlink-manager/ to aquire the codes, it does detect the device and puts it into learning mode, however nothing is learnt it was inconclusive, so i’ve dropped it

  • following this https://github.com/NightRang3r/Broadlink-e-control-db-dump to aquire the codes i’ve learnt how to make python and pip and python scripts run on windows 10, moved from the ihc app to the e-control app in order to get, with some editing, to this broadlink.map file:

Dario_Luce_Toggle = b20b1c00090f0908100f080f080f080f080f080f08081008100f090f09000100000000000000000000000000
Dario_Led_On = b20e1c00090f090e080f080f090f080f0808100f09081008100f090f09000100000000000000000000000000
Dario_Led_Off = b2211c00090f080f090e080e090f080f090f090810081008100f090f09000100000000000000000000000000
Dario_Dimmer = b2c11c00090f090f0908100f090f090f080f080f08071008100f080f09000100000000000000000000000000
Dario_Vent_Off = b2211c00090e090e080f090e090e0908100f090f09071007100f090e09000100000000000000000000000000
Dario_Vent_1 = b2371c000907100f080e090f080f080f090f090f09071007100e090f08000100000000000000000000000000
Dario_Vent_2 = b1121c00080f080f080f08080f0f080f080f080f08080f080f0f080f08000100000000000000000000000000
Dario_Vent_3 = b2161c00080f080f090e090e0807100f090e090f09081007100f090f09000100000000000000000000000000
Camera_Luce_Toggle = b2071c00090f0907100f090f090f090f090f09100807100f090f080f09000104000000000000000000000000
Camera_Led_On = b2121c00090f0910080f090f090f08100808100f0908100f090f090f08000105000000000000000000000000
Camera_Led_Off = b20b1c0008100810080f080f080f080f080f08081008100f080f080f08000104000000000000000000000000
Camera_Dimmer = b2aa1c00080f080f0808100f080f080f080f080f0808100f080f080f08000105000000000000000000000000
Camera_Vent_Off = b1251c000810071008100810081008080f10081008080f0f080f081008000105000000000000000000000000
Camera_Vent_1 = b1251c000808100f080f080f080f080f0810080f0808100f080f080f08000104000000000000000000000000
Camera_Vent_2 = b2121c00080f090f090f0808100f090f090f090f0908100f090f080f08000104000000000000000000000000
Camera_Vent_3 = b20e1c00080f090f090f080f0907100f090f090f0808100f090f090f08000104000000000000000000000000
Sogg_Luce_Toggle = b21a1c0009100908111009100911091009100910091009100810090811000117000000000000000000000000
Sogg_Led_On = b1161c0009110911081108110810091109091110091008100811080811000117000000000000000000000000
Sogg_Led_Off = b2121c0009100910091009100910091009100908111009100910090811000116000000000000000000000000
Sogg_Dimmer = b2b21c0009100910090811100910091009100910091009100910090811000116000000000000000000000000
Sogg_Vent_Off = b24a1c00091009100a100910091109091110091009100a100910090911000116000000000000000000000000
Sogg_Vent_1 = b23b1c0009081110091009100910091009100910091009100910090811000116000000000000000000000000
Sogg_Vent_2 = b1421c0009100910091009091011091008110911081008110811090910000116000000000000000000000000
Sogg_Vent_3 = b14e1c0008100911081108110809101108110811081108110811080910000116000000000000000000000000

It scares me that respective to most hex codes posted so far mine seem to be 1/2 to 1/3 of the lenght of the others’, and that some commands (like the dimmer ones) should last for about 4 seconds (and they do when commanded from the app) but the string is just as long as the others.

anyhow, now, 2 questions ( i can’t keep going today)

  • could the hex strings be so short?
  • linked items MUST be created from the items file? isn’t it enough to create them from paper ui? i’ve tried to create one, it being a string iìm not even sure how to activate it

(Frederik) #635

I have submitted a pull request that fixes the issue of SP2 and SP3 always reporting as OFF. Further I have discovered that some parts of the Broadlink binding has an issue where the devices’ acknowledgment packets sent as a response to a command is not handled - causing different issues for different devices.

In my PR for SP2 and SP3, this problem is solved! It is a very small fix and it should be easy to extend this to other devices as well!

PR: https://github.com/themillhousegroup/openhab2-addons/pull/1

The Power consumption values of SP3s are never read since it is not implemented in the binding yet, but having gotten to understand the binding a bit I might implement this and the Night light switch in the near future.


(John Marshall) #636

This is outstanding work @FreddyFox - I’ve approved your PR, merged it and have just published BETA-8 which includes your SP2/SP3 fixes. Thankyou so much for helping with the development of this binding - I don’t (yet*) have an SP- device to test with so your contribution has been really valuable.

BETA-8:
https://dl.bintray.com/themillhousegroup/generic/org.openhab.binding.broadlink-2.4.0-BETA-8.jar

(*) I did recently order an SP3 Mini, which should arrive next week. Will be very interested to see if it works “out of the box” with this binding.


(Jörg Mahmens) #637

@themillhousegroup
I’ve tested the BETA-8 with succes for two SPMini2.
State will be regognised on startup and stay as set.
But PowerConsumption still dosn’t work for Mini Devices.
Many thanks also to @FreddyFox


(Dario) #638

@themillhousegroup
It’s been a learning experience(never had to edit *.items files as of yet), but i got the binding to work!
i’m on beta7 - didn’t have the time to switch to beta 8, tho there shouldn’t be any difference for the only rm3 ihave.

To anybody whom might be interested:
The codes acquired following this https://github.com/NightRang3r/Broadlink-e-control-db-dump have worked for me so, if you have a rm pro that leads you in the manual to use the IHC app, you can install instead the e-control app (also by broadlink) and follow that guide to aquire the hex codes. The only slippery bit being finding the matching versions of simplejson and python2.7 (doesn’t work with other releases) for your system.

for me, the next thing is discovering how to expose correctly these items to google home now :scream::rofl:


(John Marshall) #639

I’m about to publish a blog post that might help … :slight_smile:


(Smhgit) #640

@themillhousegroup

Did u had a chance to go over my debug logs to identify the issue with RM3?

Thx


[SOLVED] How to transform a string item to a switchable one to expose
(Dario) #641

if anybody is wanting to implement something of the likes of:
google home>openhab>broadlink binding>rm sending commands

Dim helped me with it in that post :wink:


(Angelos) #642

@themillhousegroup : Good job on picking up from where Cato left things.

Maybe you want to startup a new thread for your Broadlink Binding (https://github.com/themillhousegroup/openhab2-addons/tree/master/addons/binding/org.openhab.binding.broadlink)

This thread is a mess :slight_smile: It is hard even for me to find proper info in here.

If you need Moderator help to move selected posts over to a new “Broadlink Binding Alpha” thread, please let me know.

Keep up the good work and active development of the Broadlink binding ! :+1:


(Jorg Coevert) #643

Hi John,

I tested the BETA-8 and it works now on my SP3 !
The status is now shown as it should.
Thank you so much for your effort.


(Smhgit) #644

I found that this is already supported via pollingInterval

I’ve changed it to 600 seconds


(Dario) #645

where did you find the polling interval for this binding?


(Frederik) #646

PaperUI -> Configuration -> Things -> “your device” -> Edit (the blue circle with a pen) :slight_smile:


(Dario) #647

?it’s not there?


(Frederik) #648

Ah, it doesn’t seem to be specified for the RM3 device (https://github.com/themillhousegroup/openhab2-addons/blob/master/addons/binding/org.openhab.binding.broadlink/ESH-INF/thing/thing-types.xml#L474-L529)
Weird that @smhgit apparently found it!


(Smhgit) #649

@FreddyFox

I’ve found it in the ESH folder at the thing definition. You can use it in the thing file definition (if u are using files for things)

Thing broadlink:rm3:34-ea-34-e3-c1-ca "Broadlink RM3 2" [ ipAddress=".....",
  port=80,
  mac=".....",
  authorizationKey="097628343fe99e23765c1513accf8b02",
  iv="562e17996d093d28ddb3ba695a2e6f58",
  mapFilename=".....",
  pollingInterval=600
  ]

(John Marshall) #650

Thanks @Dim, I think it would be good to start afresh - over 18 months of stop-start discussions can definitely be condensed down!


(John Marshall) #651

Anyone who is interested in hooking their Broadlink RM- or SP- device up to Google Home, there a couple of little tricks you may need to employ to get Switchable items to work, so I’ve written up a blog post about it.

It’s working well for me with an RM3 Mini sending IR commands to Daikin and Panasonic airconditioners:

Hope it helps


(Angelos) #652

:+1:

we have 3 options:

  1. Split this thread to a new one starting from post #572 to keep the recent developments
  2. You create a new empty Thread titled “Broadlink Binding Next-Gen” (or something similar :slight_smile:)
  3. You select the posts that you want to be transferred to a new thread from here and we create a new one based on your selection

What do you prefer?

Of course, we will add a placeholder on the first post in this thread to point to the new thread