openHAB zmote binding

No, I just read the documentation and browsed the code.

However, the maintainer of the GlobalCache plugin has extended his plugin to support ZMote devices as well. So I’m not sure if I should put any more effort into this plugin, as a pull request will most likely not get accepted if there is support from another plugin already. After all, both plugins would basically do just the same thing.

I see, maybe you can contribute ideas of yours there?

@mhilbush what do you think?

@ThomDietrich My goal was to add to the GlobalCache binding only enough zmote support so that it’s compatible with all the other GlobalCache devices (GC-100, Itach, and Itach Flex). This was easy to add because the zmote shares the same IR api and discovery mechanism as the GlobalCache IR devices. It literally was about an hour of work to add it (and that was when I was still pretty jet-lagged from flying back from Asia to the US, LOL).

I would prefer to not add any zmote-specific functionality to the globalcache binding. So, IMO, integrating with the rest of the zmote ecosystem is probably best left to a binding specific to zmote, which is what @Temar seems to be working on.

Hi guys.

Although zmote has GC API compatibility, it is just one part of zmote functionality. It has a lot of additional features.

For instance, it supports macros. You can send multiple IR signals in a single command, with configurable delays in between. It is useful for scene setting or for changing channels.

zmote also supports remote access over MQTT and through HTTP-to-MQTT bridge, which can be useful e.g. for controlling devices at your home from your office.

There are many more features under development. A dedicated binding will enable OH users to make use of them.

Urmil

2 Likes

Hi guys, how can i install the first version of the binding? I have copied the JAR file in the addons folder and restarted openhab… but it does not appears in the bundle:list… What have I done wrong?

Copying the JAR into the addons folder should be enough. That worked for me and others. You can try to start it manually by entering:

start org.openhab.binding.zmote

You can also install the binding from the Eclipse Marketplace, as described here: Distributing bindings through the IoT Marketplace

@Temar: Worked! Thanks…

Hey Alex,

I’ve tested your bindings for a few days now. I’m using sendkey as well as sendcode inside my sitemap and inside rules. Everything’s working as expected. I ended up using sendcode more because I found editing the json file cumbersome and converting an IR code is quite easy using the converter - this way I’m not dependent on the zMote webapp.

You should consider supporting a map file for IR codes. It would also be amazing if your binding included the converter (you can probably ask @urmilparikh for the code or specifications) allowing codes in the other more common formats, e.g. NEC1 2 160 8.

By the help of your binding I’ve implemented one of the coolest rules my home might have seen so far, and it’s dead simple:

rule "Sound System: Switch between PC input and Sonos input channel"
when
    Item KodiPlayerState changed
then
    if (KodiPlayerState.state == "Play") WZ_zMote_sendcode.sendCommand("38000,2,69,343,171,21,22,21,65BBBBBBBBBBBCBCBBCBBBBBCCBCCCCC21,1672,343,86,21,3730")
    else if (KodiPlayerState.state == "Stop") WZ_zMote_sendcode.sendCommand("38000,2,69,343,171,21,22,21,65BBBBBBBBBBBCBCBCBBBBBCCBCCCCCB21,1672,343,86,21,3730")
end

What are your plans for further development? You should consider opening a pull request to get the binding into the openHAB distribution before Version 2.1.

Best! Thomas

Isn’t that possible already by just defining a map? I’ll give it a try these days.

I’ll ask him. I could also just send a web service request to his server. That was planned anyway when implementing support for reading IR codes.

Basically I wanted to implement support for reading IR codes and the IR code cleanup. Maybe also support for sending one key multiple times. However I’m quite busy atm, as I’m doing my sailing license. This pretty much takes up all my weekends for the next month.

I can send a pull request these days. I just wanted to wait a little while to see if there are any bugs left. So far I didn’t find any, so maybe it’s indeed a good time to send a PR for this version.

1 Like

I just received my two zmote devices and managed to connect them to my WIFI.
Using the examples I was able to turn on/off a TV and change channels up/down.

My question is: How can openHAB2 determine what the current state of the TV power is? If openHAB is the exclusive control, you can keep track of it, but if somebody is still using the original remote, the state can change without openHAB knowing.

Here is an example I see where this would be a problem:
I have a “vacation” setting, where the TV should be turned ON at a certain time and turned OFF again after some time. That will work fine if the initial state of the TV is OFF. But if for some reason I forgot to turn the TV off before leaving (and after enabling the “vacation” rules), the openHAB rule would invert the desired behavior, that is the TV would turn OFF at my intended ON time and would turn back ON after the rules programmed delay time. In a way, the TV should be able to be queried or alternatively, there should be a dedicated ON IR code and a dedicated OFF IR code. I have not seen that in my short time of investigating IR codes, the only thing I see in most definitions is POWER rather than POWER_ON and POWER_OFF.

Does anybody have some insight on this?

Classic problem with power IR codes that toggle the power on-off-on-off-etc… The only way you can reliably do what you want is if the device being operated has discrete on and off IR codes. Some devices have discrete on and off codes, and some do not.

As @mhilbush said, many devices have discrete codes for ON and OFF. These buttons are not present in plastic remotes, so difficult to find their codes.

But, there are few ways to find them:

  1. Check if you they are listed here, in which case, you can convert them to use with zmote.
  2. Many TVs I have seen, turn ON when you press CH+ or CH- keys. Find out if your TV turns ON using any other keys.
  3. If you have a little patience, you can find out if your TV has discrete codes (well, some hidden features as well :wink:) using zmote. But that would be a separate guide…

If you have a smart TV (device is in network), you can use network binding to identify if TV is on. Of course there is a small delay and you need a smart TV.

What I would like, is that zmote could raise an event when ever it can identify remote control pressed. So when I open TV with remote, I could change the room lightning.

@sl92656 I had the same problem and solved it by adding a power consumption measurement module in front of the device (speaker system in my case). You’ll be able to decide if the device is off (e.g. P < 5W) or on (P > 30W). See:

1 Like

Thank you all for the great suggestions :grinning:! I was afraid that there was not an “easy” solution available.

@Ari_Hagman unfortunately my TVs are “dumb” otherwise the WIFI route would have been the way to go (maybe it’s time to convince the boss to go for the new 60", naah…:grin:)

@urmilparikh your suggestion to “work” the original remote to find any other key that will trigger the ON action sounds good, and I’ll check that with my TV. To your 3. suggestion, that sounds interesting; I will have to investigate if writing a “code scanner” to find any hidden codes to trigger TV ON would be feasible (the downside will be, that in order to automate it, I’ll have to find a way to detect the ON state, which makes
@ThomDietrich suggestion to use switch&power meter appealing. It would make the power analysis part a little bit challenging, having a number of different devices connected in my entertainment system to one meter (DVD,Receiver,TV,…); If all breaks I could do a “cold boot” i.e. turn main power off and then on, which should initialize all devices to OFF.

Thanks again for the suggestions and I’ll report back once I figured it out!

Hi Urmil,

can help me to

@urmilparikh: how can I convert remotecentral codes to zmote, so that a new button in a zmote sends this code?
Thanks for your help!

Best,
~Thomas

Please use online converter tool from here: http://www.zmote.io/irtool

It supports conversion from Pronto HEX format used by remotecentral.

Great your linked page can convert it!
I can send the code from withing openhab2 zmote plugin with a sendcode command or with a modified json file with sendkey command as well, but how do I configure one button of the zmote web app to send this new code?
Thank you for your support!

That feature is not available right now, but it is there in our TODO list and should be available very soon.

OK, great thank you for you fast reply! I can wait because it’s not an urgent requirement as long as it works from withing openhab2 and I can control the devices via Alexa.