Memory leak?

Right now this endpoint sets default value, which is what a device would use if no values were defined explicitly (upon save). This will change so that hitting a URL will override all devices' settings, but it will not be in a hotfix. Unless something very serious breaks, 2.2.4 is closed.

I'll check if there are any low hanging fruits there that could speed it up.

5 Likes

Victor - just wanted to say thanks! Your Java skills have made a huge positive difference to the platform. It is like night and day!!

11 Likes

Ok, but don't break it.

Many of us are doing hundreds, and in some cases multiple thousands, of Maker API calls per day. You break it, we get out the pitchforks :fire::fire::fire: . :wink:

7 Likes

same here with 200 devices.. that is why i use built in and limit devices for each dashboard and also my copy of smarttiles which updates as each device updates instead of all at once like when you bring a dashboard using makerapi up.

that said maker api is usefull i use it in a limited fashion with my garmin watch to turn certain things off an on etc. but not a dashboard that is constantly doing urls to all devices.. Probaly ok for like 20 devices at most would be my guess.

3 Likes

Try setting dashboard refresh interval to a larger interval. Unless there's a practical reason to poll it every 2 seconds, it will make a big difference. And yes, I'll be taking another look at dashboards.

2 Likes

I use the Maker API from a completely separate application that is much richer than Hubitat can provide. Introducing RoboDomo

I was polling getAllDevices() once per second and rebooting the hub every few days when it crawled or stopped altogether. I went to every 2 seconds, but that barely helped.

Why poll so fast? If you turn off a switch manually, you want to see the tile in the UI change state quickly or the whole thing feels sluggish from the lag.

Bugs/suggestions:

The post endpoint solves the need to poll. But some z wave devices do not report state change on manual change, so the need the z wave poller, which adds some lag but beats having invalid state.

I can’t use poller for fans, only switches and dimmers. This seems like an oversight.

I don’t think you can set up the post API to work with multiple endpoints. A better WebSocket API would be ideal.

I don’t think there’s a way to unset the post API endpoint.

Maker API should let me post an array (JSON) of devices and states so I can send such an array to turn off 35 of my 50 things with one http request.

I want an arrival or geofence for each person and each vehicle. Any hubitat solution would be ideal, but I am looking at putting a Bluetooth device in each vehicle and polling for Bluetooth devices from a Linux system to determine if the device (vehicle) is in range. Not sure if hubitat has BT hardware, it would be the win.

you can right a rule machine rule to start polling or even manually start it from the device handler for a fan as long as the handler supports it.. the one i am using does.

I know. But I can’t use poller, like I said :wink:

EDIT: I don't see how to quote a post I'm replying to. This was to the "you can write a rule machine rule..."

1 Like

If you highlight the text in the post you want to respond to, you should see a "Quote pop-up appear, click this and it will take you into the regular reply dialog. You can also do the highlight and quote steps while typing a reply and the quote will be pasted into the reply dialog for you.

3 Likes

With the comments made earlier in this post re the performance of C-7 hubs vs C-4 hubs... I have an existing C-4 hub and a new C-7 hub ready to setup. I was considering moving my devices and closely related rules to the C-7 hub and leave any problematic apps/devices, cloud-based integrations, etc on the C-4, perhaps even my dashboards running on my C-4 as well. Would it be better to also port my dashboards to the C-7 hub?

@mykesx Please excuse my ignorance but how does your integration use Maker API differently than the Hubitat Nodes in Node Red or Home Assistant integration? I have one installation of Maker API for each so any change in Hubitat sends a POST from Maker API. There is no need to poll anything and no real strain on HE hub.

There is a node in Hubitat's Node Red integration to get all device attributes of every device and it I were to push that 3 or 4 times in a row, I could lock up my hub instantly in early versions of Hubitat Node Red pallet.

Laymans answer please if there is such a thing in this case. :smile:

3 Likes

thats fine.. but if you have a dashbaord using it with all your devices it may queries every device when you bring it up.. your use case is different

1 Like

Agreed, these were my thoughts too.....

That doesn't make sense to me. It sounds like you are saying that this dashboard has to query every device on it at the update interval even if nothing changes. I have my Dashboard in Home Assistant that is accurate but it's not polling every device every 2 seconds to do so. It's reacting to any changes that it has received from Maker API. I don't have any Node Red dashboards but I didn't think it would work that way either.

When Node Red starts, it does initialize every Hubitat device but it only does that once at beginning and it usually takes 5-10 seconds. After that, it keeps the status of each device in cache and only changes on receipt of a new POST from Maker API if I understand the process correctly. @JasonJoel and @fblackburn know much more than I do.

I am not questioning the method. I am just trying to understand for my own education.

I am using the NR dashboard and I have it set to react to events via the HE device node no polling required - although I guess you could do it if you really wanted too. Also have some subflows that use the generic events node for things like battery levels. Everything reacts to Makers posts.

My understanding is the same as your @stephen_nutt but happy to be corrected if wrong.

I never said anything about node red. You did. All I.know is there are dashboard apps that query every device when you bring them.up. i tried one and quickly stopped using it. You are misinterpreting my comments.!

I am just trying to compare something I know a little how it works (Node Red) to how the dashboard in this thread works and it sounds like it is querying every device on a dashboard every 2 seconds so I can understand how that would be taxing on the hub. I accidentally had a Hubitat Device Node that queried all devices every time I deployed and if I deployed a few times within a minute for whatever reason, I would shut down the hub. Fortunately the creator of the Node Red Hubitat pallet changed something so that initialization process now is done MUCH quicker.

Not quite I am looking at it from the point of the Maker API posting the events which any external dashboard/app should be able to receive via a webhook without requiring expensive polling (except for initialization of course).

Before I knew of the post url for Maker API, I had to use getDevices() and poll. I don’t do that anymore, my hubitat microservice uses the events WebSocket AND the post URL of Maker API.

To handle the post from hubitat, I had to implement an Express server to handle the posts.

It works fine.

I do one getDevices at startup to build a hash map for converting device names to device ID suited for the Maker API http get urls.

If you want to detect newly added devices, you need to call getDevices(j.

Sorry if I have the function name wrong. You should get the gist.

1 Like

The clouds have parted and the skies are blue!!!!! :grin:

Please don't think i was questioning anything to your methods. I was just trying to learn. The stuff that guys like you can do is AMAZING!!!

1 Like