Working on Basic Hubitat Activity Integration but Hitting Fundamental(?) Limitations

I’m trying to write a basic Hubitat integration to support turning activities on and off to replicate functionality I had with my old Harmony remote. Basically all I want to do is have the Hubitat check the status of the activities at a fixed time (e.g. midnight) and turn the active activity off (i.e. turn the TV off at bedtime).

After a lot of messing around, I was able to get the list of activities and their state from the remote into Hubitat devices (I had to use basic authentication as nothing I tried to get an API key worked). The next problem was changing the state of the activities - this didn’t work (I got 404 errors when trying to send service start or stop commands no matter the combinations I tried) - as starting or stopping activities supported, or can you only get their states?

Finally, and this is probably the showstopper, as the remote itself sends the commands, not the docking stations, once it goes to sleep, it is non-responsive to any query or command and there is no (that I can find) way to remotely wake the remote, therefore any external command to the remote isn’t going to work unless the user wakes the remote up. This is fundamentally different to the Harmony for example where the base station was permanently online and sent the commands, the remote just send user inputs to the base. This seems like a fundamental limitation, specifically for activities, as if any other device controls any of the devices in an activity, the activity is out of sync. So for example I could directly check the state of the devices the activity controls and turn them off if necessary, but next day the remote will be out of sync, thus breaking the activities.

There are only two methods to resolve this that I can see - 1. an ability to wake the remote from an external device (but this seems unlikely to be possible as the device’s WiFi connection is inactive, so there’s no way to communicate with it as far as I can tell) or 2. have the activity state dynamically updated to match the actual state of the controlled devices (should be possible, but its an inelegant fudge).

Am I missing something or is this simply not going to work given the Remote 3’s fundamental architecture?

The remote supports wake on lan if you enable „Keep WiFi connected in standby“ in power saving settings.

I see no “Keep WiFi connected in standby““ option in Settings / Power Saving. I only have Wakeup sensitivity, Display timeout and Sleep timeout. This is the same in the web configurator and on the remote itself.

Which firmware do you have?

I do almost the same you try with my home automation IP Symcon. I can

  1. get an API key
  2. get status of remotes/activities with the WiFi limitation
  3. start/end macros/activities
  4. send command to entities

What problem do you have with API key? Simplest way is with the API of the web configurator. You can create a KEY BUT you must immediatly copy the key because there is no way to get this key again. After these tests I wrote a PHP script which automatically deletes old key with the same name and creates a new one and stores it in a variable.

Ralf

When I try to get an API key (just testing via the command line), I get an error:

{"code":"NOT_AUTHORIZED","message":"Authentication error"}

The command I’m using is:

curl -X 'POST' 'http://<IP ADDRESS OF REMOTE>/api/auth/api_keys' -H 'accept: application/json' -H 'Content-Type: application/json' -d '{"name": "<name_for_the_key>", "scopes":["admin"]}'

Your missing the basic auth credentials to create an api key. Username is web-configurator and the passwort your pin. This is mentioned on the api page (http://remoteip/doc/core-rest/)