[SOLVED] Espmilighthub - monitor more than one remote

@matt1
Hi there, I have two Milight remotes 0x123A (4666 decimal) and 0xAC85 (44165 decimal), the hub only listens to and tracks 0x123A. Is it possible to listen to both remotes on the same hub, possibly by using an or ‘|’ on the thing_id or such ?

Or do I need another hub running ?

Things entry:

Bridge espmilighthub:esp8266Bridge:4666 [ADDR="tcp://192.168.0.10:1883"]
{
    Thing rgbw 0x123A0 "All Lights" @ "RaSTuS' Home"
    Thing rgbw 0x123A1 "Lamp" @ "Bedroom"
    Thing rgbw 0x123A2 "Bedroom Light" @ "Bedroom"
    Thing rgbw 0x123A3 "Lounge Light" @ "Lounge"
    Thing rgbw 0x123A4 "Bathroom Light" @ "Bathroom"
}

Item:

Switch Bedroom_LampSw   "Lamp - On/Off [%s]"      (Bedroom, Lights)     ["Lighting"]   {channel="espmilighthub:rgbw:4666:0x123A1:level"}

You may be confused with the UniqueID of the hub/bridge which you have set as 4666 in the example above. There is no need to convert the remote ID into decimal and set the hub as that number. Please see the examples in the readme, you can put multiple remotes under the same HUB/BRIDGE and it can be any number 4666 or any other it does not matter…

If you are wanting to control the same globe with 2 different remotes and have the same controls in Openhab update, then this can be done in 1 of 2 ways…

  1. Use Openhab rules to forward on any movements made with the secondary remotes to the primary controls in openhab. Doing this for a lot of controls would be messy so it may be easier to do it with method below.

  2. Setup the broker to bridge/ auto convert the topic for you, see here on how someone used it to replace fut089 with rbg_cct. You could do the same thing to change one remote to the second ones ID so the binding only sees 1 remote…

1 Like

Brilliant, thanks Matt, I knew you’d have an idea.

Will try the 2nd method and cross my fingers.

Ended up using the mosquitto bridge method.

mosquitto.conf (Note: clientid’s, username and password not needed)

connection milightworkaround
address 127.0.0.1:1883
topic # both 0 milight/states/0x123A/rgbw/ milight/states/0xAC85/rgbw/

But also came up with a 3rd option that works.
Things:

Bridge espmilighthub:esp8266Bridge:4666 [ADDR="tcp://192.168.0.10:1883"]
{
   // Remote 1
    Thing rgbw 0x123A0
    Thing rgbw 0x123A1
    Thing rgbw 0x123A2
    Thing rgbw 0x123A3
    Thing rgbw 0x123A4
    // Remote 2
    Thing rgbw 0xAC850
    Thing rgbw 0xAC851
    Thing rgbw 0xAC852
    Thing rgbw 0xAC853
    Thing rgbw 0xAC854
}

item: (separate both instances with a comma)

Switch Bedroom_LampSw   "Lamp - On/Off [%s]"    (Bedroom, Lights)    ["Lighting"]    {channel="espmilighthub:rgbw:4666:0x123A1:level,espmilighthub:rgbw:4666:0xAC851:level"}

Thanks again for the guidance Matt.

1 Like

Glad it helped and I really like your option 3 more then the bridge idea, as in the future it will be easier to find and understand plus backups may capture it more completely if your broker is located on another machine. Thanks for posting it…

A tip I found was not to define a group 0 Thing. Instead I used the Openhab group concept, the examples in the readme has an example of doing this. The reasons for doing it that way off the top of my head were:

  • Google home correctly state 4 lights are turning off, instead of a higher number.
  • For lights that take 5 globes it kept things consistent.
  • When asking google/openhab to turn all lights off, it actually created more traffic and took longer as it would send off commands to all the globes individually and then also to the group 0 things.
  • The hub did not until recently track the states of group 0 and even now it misses the saturation tracking as group 0 does not really have a state.

This is why PaperUI and a search will not auto find the group 0 entries.

Hi Matt, using group 0 is a leftover from the original Milight Hub which only was retired a week ago. It still works to turn all lights on/off so is handy, but beyond that it does nothing, as you mention, the state tracking for it is not very good.

I have a non-operational Google Home Mini, but I don’t use it, doesn’t like my wifi’s 64char passwords, and I have way too many devices setup to go changing that, so it sits in it’s box in the cupboard.

As a matter of interest here’s a screencap of my AllLights group:

EDIT: just noticed my tv app was overlaid in the bottom right, just ignore that, LOL.
EDIT2: all my editing is done by editing the config files under /etc/openhab2/*, don’t use paperui except sometimes to see if something is active or not, but no config is done there. BTW: I’m running the Bintray debian apt package repo (2.4.0-1) on a Linux Mint PC.