Harmony Hub

I’m having the same problem @clemon79

You can see how I used mosquitto_pub above but I could not get this to work either.

With mosquitto_sub I get the states also:

pi@raspberrypi:~ $ mosquitto_sub -v -t ‘#’ -u pi -P password
harmony-api/hubs/harmonyhub/current_activity tv
harmony-api/hubs/harmonyhub/state on
harmony-api/hubs/harmonyhub/activities/tv/state on
harmony-api/hubs/harmonyhub/activities/xboxone/state off
harmony-api/hubs/harmonyhub/activities/appletv/state off
harmony-api/hubs/harmonyhub/activities/androidtv/state off
harmony-api/hubs/harmonyhub/activities/pc/state off
harmony-api/hubs/harmonyhub/activities/plex/state off
harmony-api/hubs/harmonyhub/activities/xbox360/state off
harmony-api/hubs/harmonyhub/activities/poweroff/state off

I have now downgraded to an older version for the time being and it’s working perfectly again.

Well, I thought I read someplace that the way things are declared might have changed, which is why I wanted to try to do it from a command line, but I need help with the syntax for mosquitto_pub in order to test that. If it’s a function of the current version of harmony-api being broken then that can be addressed but I at least want to know I’m doing it right. :slight_smile:

Can confirm I’m experiencing the same, running a local mosquitto server.

Not actually sure if this is the correct format but I’ve tried both of the below, and it doesn’t cause any action. I’ve tried both of the same with activities, to the same result.

On the flip side, sending a POST request via curl to the harmony-api web server is still working.

mosquitto_pub -t ‘harmony_api/hubs/livingroom/devices/fujitsu-climate-control/commands/cool-18-high’
mosquitto_pub -t ‘harmony_api/hubs/livingroom/devices/fujitsu-climate-control/commands’ -m ‘cool-18-high’

How do you do the Web server request?

At the minimum you are going to need to provide username and password to the mosquitto_pub commands, aren’t you?

This is really driving me nuts and unbelievably frustrating.

Okay, so dig: When I do this:

mosquitto_pub -d -u <username> -P <password> -t "harmony-api/hubs/freds-harmony-hub/activities/watch-xbox-one/command" -m "off"

I get:

Client mosqpub/1153-raspberryp sending CONNECT
Client mosqpub/1153-raspberryp received CONNACK
Client mosqpub/1153-raspberryp sending PUBLISH (d0, q0, r0, m1, 'harmony-api/hubs/freds-harmony-hub/activities/watch-xbox-one/command', ... (3 bytes))
Client mosqpub/1153-raspberryp sending DISCONNECT

So that looks like it’s all working. But nothing happens when my TV etc. should be turning off. When I look at realtime logs for harmony-api those appear to be working, and I see state updates in my switch in hass in the web UI; the action of flipping it just doesn’t do anything. So mqtt can at least read from the hub and react to the activity state. It just can’t seem to change it.

So: I appear to be able to talk to mqtt. Mqtt appears to talk to harmony-api, and harmony-api seems to talk to the hub; we just can’t do anything. It looks above like this is a shared problem, so if there is anyone for whom 2.3.2 is WORKING, I’d love to hear about it. :slight_smile:

I removed the username and password option, as I believe I set mosquitto up without it, given it’s a (reasonably) secure home environment - although I could be wrong, I’m new to MQTT everything, this is the first time I’ve looked into it, set it up, or even heard of it :slight_smile:

To send the web request:

curl -X POST http://127.0.0.1:8282/hubs/livingroom/devices/fujitsu-climate-control/commands/cool-18-quiet

I haven’t seen any logs like yours (above) when sending the MQTT command, so perhaps I do need to configure username/password

The -d argument runs the command in Debug mode, which produces the logs.

Ah right, cheers.

Seems I do get the same - so no username/pass required.

At least until I get this working and start configuring any ‘real’ devices

mosquitto_pub -t ‘harmony_api/hubs/livingroom/devices/fujitsu-climate-control/command’ -m ‘heat-24-high’ -d

Client mosqpub/20424-cyrus sending CONNECT

Client mosqpub/20424-cyrus received CONNACK
Client mosqpub/20424-cyrus sending PUBLISH (d0, q0, r0, m1, ‘harmony_api/hubs/livingroom/devices/fujitsu-climate-control/command’, … (12 bytes))
Client mosqpub/20424-cyrus sending DISCONNECT

Bumping because I’d really like to get to the bottom of this, since my HASS integration is broken until I get it working, as HarmonyHubControl doesn’t seem to want to work anymore…

1 Like

FYI, I just updated harmony-api and this seems to be working again now, with no further configuration changes on my part.

Edit: I also updated HASS to the latest version a couple days ago, just in case it turns out to be relevant - but it wasn’t working after that.

Hi,

Im having an issue where any command sent to harmony api on my rbp stops working and in the logs i find lost connection to hub…everything works back again if i restart the harmony pid, is there anyway to have it auto reconnect if for any reason the connection is lost to the hub?

is this possible now?