Maker API should use Hub Variable API

Currently Maker API must use a connector to read Hub Variables. It seems that the Hub Variable API was released after Maker API was developed and that Maker API hasn't been updated to use that API.
Please consider making that update to Maker API so people can get rid of those connectors.
ps. Do other built-in apps need the same update?

While it wouldn't be impossible to add this to Maker API (can't speak to the likelihood...), you may not be aware such an API already exists (the HTTP API would be the most relevant here, though there's also one on the hub for use in your own Groovy apps):

https://docs2.hubitat.com/en/apps/rule-machine#using-rule-machine-from-http-requests

What do you mean? Any app can use this API if it wants to, and many built-in apps do where it makes sense. Do you have another example? Connectors are a sort of legacy feature that originated before the API and still allow any app (even older ones that don't know about variables) to use them without knowing they are variables at all since they behave like devices.

I mean those app that still use connectors. It would be great to get rid of the entire connector list in the device list.

Which apps? No apps create or use connectors on their own if you do not specifically create or select them yourself.

(If you have moved your entire use over to direct hub variable usage, you can remove the connectors.)

I only have used RM, Maker API and HSM, so I have no idea which built-in (Hubitat or vendor produced) apps still use connectors when the Hub Variable API is available to use.
My suspicion is that not many of the legacy apps were updated to use the HV API. In my professional experience, few software organizations put newly available features in legacy products when they "already work".
So I can't give you a list, as I was really asking a question....

Well, no app will use a connector unless you tell it to, and an app can't tell a difference between a connector and another device type (nor does it need to look for connectors specifically) because connectors are devices. :slight_smile: So, without a specific example, it's hard to say more. In some cases, this could be a feature request you can make for the specific app; in others, the app might intentionally be simple enough that hub variables are outside its scope, and a more powerful option would be more appropriate (e.g, Basic Rule compared to Rule Machine).

Hubitat also has no control over what third-party developers do, but if you have one you think would work well with hub variables, most developers are receptive to community feedback. In this case, I'd suggest stating your use case and asking the developer. Typically developers create a topic in the forum to discuss their apps or drivers, and that is often the best place to do this.

Regarding "legacy" apps, there are some things that are certain to never happen: Rule 4.x and older will never get direct access to hub variables, for example. That is a big reason why Rule 5.x (and the new Rule Machine parent app, replacing what is now Rule Machine Legacy) was created in the first place, so if you need them there, the solution is to replace your old rule with a new one. But hub variables have been added to many existing products, including Hubitat Dashboard, that predate the feature.

1 Like

No built-in apps use connectors, or ever have.

Any app that allows selection of Hub Variables is making system calls with those published methods. The API was published to satisfy user requests to be able to use Hub Variables in custom apps. The published methods have existed since the introduction of Hub Variables. There are a few built-in apps that allow Hub Variables in certain limited contexts, with only RM having a really complete set of functions.

I'm not sure that this topic has any further gas in the tank ???

2 Likes

Then why doesn't Maker API? My bad assumption was that if Maker API didn't use it then others wouldn't either. With barely 6 months into Hubitat I really don't know the history.

In any case, my original question was about Maker API using the Hub Variable API so we don't need connectors to access Hub Variables.

Please add this functionality to Maker API.

Are you aware that another API for this already exists, as I linked to above?

1 Like

Yes I have already tried that API, but since I do not have any current developer skills, I can't find a way to get the access code that I need.
There is another post where I asked for help to discover it, but got none.
[edit] I have discovered that adding end point triggers to a rule gives that rule data in the Application State section on the App Settings page. There is an accessToken as the first variable in the Application State list. Not sure that the rule ID is from the installedRules array is the correct rule ID for the HTTP call. I get Not Found error when using that value and the access token when I try to run a rule.

It seems you might be trying to use the Groovy API. You want the HTTP API, and in that case, whatever skills you need are the same you'd need for Maker API.

I looked though your entire posting history (which is public) and I do not see any such posts. Can you point to the one?

I did find the post where I already gave you information on the exact API above, but I don't see any additional questions...

You don't need to dig into Application State. Start with the local (or cloud) endpoint URL that the RM UI gives you to trigger the rule. If you're following the docs, this might look like:

http://192.168.0.36/apps/api/10249/trigger?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db

Then add the endpoint you need, so in your case, possibly something like:

http://192.168.0.36/apps/api/10249/trigger/setHubVariable=varName:varString?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db

(This variable must already have been created on the hub, and you must know the name.)

1 Like

Thanks, I went right past that link in setting up the end point.

I have a couple dozen connectors used mainly with webcore. Did not know that I could remove them. Here I go....pretty sure I will break something.

1 Like

To be clear, I meant if you are not using them, the same as any device. :slight_smile: WebCoRE can use hub variables now, but if you were using connectors before, you'll have to swap them out yourself--there's nothing automatic.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.