Plugin: Harmony Hub Control

I see this in the startup log:

openLuup.chdev:: [string "L_Harmony.lua"]:212: module 'cjson' not found:
	no field package.preload['cjson']
	no file './cjson.lua'
	no file '/usr/local/share/lua/5.1/cjson.lua'
	no file '/usr/local/share/lua/5.1/cjson/init.lua'
	no file '/usr/local/lib/lua/5.1/cjson.lua'
	no file '/usr/local/lib/lua/5.1/cjson/init.lua'
	no file '../cmh-lu/cjson.lua'
	no file 'files/cjson.lua'
	no file 'openLuup/cjson.lua'
	no file './cjson.so'
	no file '/usr/local/lib/lua/5.1/cjson.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'
2020-07-07 10:32:07.341   luup.create_device:: [71] D_HarmonyDevice.xml / X / D_HarmonyDevice.json   (urn:schemas-rboer-com:device:HarmonyDevice:1)

Is cjson needed since one of the latest releases? I guess I’ve missed it. Could this be the cause of the issue? Will take it up with the creator of the docker of openluup.

Ok, this indeed was the problem. I installed cjson in the docker container and now everything is reacting again. Version is 4.3 now.

Is there an ‘easy’ way to delete the xml and json files that get created with the device id? I changed my devices id and would like to clean up the unused files.
Would executing this work
os.execute(“rm -rf /etc/cmh-ludl/D_Harmony97.json.lzo”)
os.execute(“rm -rf /etc/cmh-ludl/D_Harmony97.xml.lzo”)

I just did a little research and the -r is probably not necessary with specifying the exact filename but seems like it could be dangerous.
I am not extremely familiar with the unix commands.

Hi @RHCPNG,

I will have a look at scenario’s where cjson is not installed. The idea is that that will still work. It works for Vera so not sure why openLuup chokes on the same lines of code.

Cheers Rene

Hi @Tim88,

You can remove all files with the old device number yes. Do not use the -r option though. You should not need any option. Other way if to use WinSCP or program like that. It is always simpler if you can see what you are doing.

Cheers Rene

@reneboer

Hello

I am seeing this in my Luup Log

v:0x11422a8/NONE duplicate:1 <0x770ca520>
01	09/06/20 16:53:38.244	luup_require can't find cjson <0x770ca520>
06	09/06/20 16:53:38.248	Device_Variable::m_szValue_set device: 184 service: urn:rboer-com:serviceId:Harmony1 variable: LinkStatus was: Ok now: Starting... #hooks: 0 upnp: 0 skip: 0 v:0x117fce8/NONE duplicate:0 <0x770ca520>
06	09/06/20 16:53:38.250	Device_Variable::m_szValue_set device: 184 service: urn:rboer-com:serviceId:Harmony1 variable: IconSet was: 0 now: 3 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x770ca520>

It might not be related to the Harmony plugin but could be ?

Any idea what is means?

Thanks.

Hi cw,

Yes the Harmony plugin looks for the cjson module as a faster alternative for dkjson. If cjson is not installed you will see the message, but there is no impact.

Cheers Rene

1 Like

Hi @Rene

I guess this is not currently possible ?

I have a Harmony Hub in my bedroom that runs my TV / Cambridge Audio amplifier (ceiling speakers) with ChromeCast video and Kodi HTPC.

In the bedroom, I also have another small Denon amplifier that is connected to a stereo ceiling speaker in the bathroom via cables. I have a ChromeCast Audio device connected to the Denon amp.

On the Harmony hub I have a “ChromeCast Audio” activity that just turns on the Denon amp and sets it to the correct AUX input for the ChromeCast Audio etc.

In the bathroom I have a ceiling mounted Google Home Mini and its default playback device is the Denon amp / ChromeCast Audio in the bedroom.

Sorry for the long background explaination, now here is my question.

I guess its not possible to have a child device of the activities of the Harmony hub in the bedroom, e.g. to have a child device in Vera in the bathroom room that just has the “ChromeCast Audio” activity button on it.

With the Harmony plugin for Vera, I can create a child device for a “Harmony device” and add buttons on to the child device for the Harmony devices command buttons.

But I cannot create a child device that has only one activity button and put that child device in a different room to where the Harmony hub is located.

Hope this makes sense? I feel I am not explaining myself very well.

Cheers

Ideally I would like a “child” device like this one I have just made in MS Paint:

image

Where the child device not only has activity buttons you can assign to it, but it also has a button for turning on / off that particular Harmony activity.

As I said my Harmony hub is in my bedroom room.

But I want this child device in my bathroom room.

So if I’m understanding this correctly you want 2 hubs activities in one device? I’m not quite following, but I think I ran into a similar situation as you.

If what you’re trying to do is group activities and device commands you’re gonna have to manually set it up with something like Virtual Panel.

Hi @cw-kid,

With the latest version of the Harmony plugin you can also create a child device for an activity and assign buttons to that. In the activity settings, set Activity Child to Yes. I think this should tackle what you are looking for.

You can put a child device in another room. look in the child device advanced settings and make sure embedded is not checked (should not be).

Cheers Rene

This is the Harmony hub device in my Masterbed room in Vera:

image

I’ve done this already:

This creates a child device for that activity.

I can then assign buttons from that activity on to the child device.

This child device is in my “Bathroom” room in Vera.

image

However its “parent” Harmony Hub device is in the “Masterbed” room in Vera, so that is working.

What I wanted was a button or a device in the “Bathroom” room, to turn on of off the “Cast Audio” activity.

Hi @cw-kid,

You can only have buttons for commands supported by your Harmony. In the Harmony control application you can also create button sequences. A sort of macro that can execute multiple commands belonging to an activity. You can create a button for that sequence on an activity device. Maybe this can do what you are looking for.

Cheers Rene

Ideally I would like a “child” device like this one I just created in MS Paint:

image

Where the child device can have activity command buttons assigned to it ( vol up / vol down) but in addition also have a button to turn on / off the actual activity.

As I said my Harmony hub is in my bedroom and this child device I want in my bathroom.

No I want 1 hub activity on two different devices in Vera, in two different rooms.

On the parent device in the bedroom, as it is now “CastAudio” button.

image

And in addition on a child device in another room, the bathroom.

Mock up:

image

@rene

When you create an “activity” child device, the plugin is pulling its list of commands from the activity right.

It does not pull the commands from the actual device itself in the Harmony.

I think I have found a bug ?

If in the MyHarmony desktop software I go to “Buttons” and then select an activity.

If I then assigned an unused button to a command, for example lets say I use the “Red” button on the remote and assign it to the “PowerToggle” command:

In Vera when I edit the activity child device that Red button or PowerToggle command is never shown in the list of available commands.

I have tried reloading the LUUP engine. I have tried setting the child device to NO and then back to Yes to remove it and recreate the child device again.

But the command list doesn’t update and show me the new button / command for selection.

Note: I am Syncing the Harmony hub in the Harmony app after I added my new button.

I’m not sure where the activity child device is pulling the commands from ?

For example its listing a command called “Top Menu”

However in the MyHarmony software for this Denon amplifier device there is NO “Top Menu” command.

There are others as well like this.

Device Commands:

image

Activity Commands:

Neither have “Top Menu”.

Ah I see you could accomplish this with the Virtual panel plugin, I currently have mine configured to have all device commands per hub in one child device. Doesn’t look exactly like the harmony hub child devices but does the job.

As for the missing power toggle command it’s purposely done in the harmony hub. I don’t know why but they hide certain device commands in activity. To combat this I added a custom IR command in app and call it something like ReceiverO (don’t name it on or off then it will be hidden like the other power commands) and teach that command to be the power toggle or whatever you want the command to be. Then it will be visible in the device commands.

I’ve already tried this, however I named my new taught custom command “PowerToggler” maybe that’s why it doesn’t appear in the activity child device in Vera. ?

That’s exactly why it doesn’t show up, the app sees that it’s a power command and hides if. Try renaming it to something random unrelated to power.

1 Like