I'm trying to create a small dashboard using an Adafruit MagTag that will periodically poll HSM, showing alerts in a human-readable form on a little gizmo stuck to the front of my fridge.
I've been trying to get this to work with the Maker API, but the responses seem to be limited to the values available in HSM Status. I guess this is useful, especially since you can set the status via the API, but does not give me the information I'm looking for.
I guess I could set up an alertHandler app that subscribes to HSM and pokes the alert into a variable that I can read via the Maker API, but somehow that seems inelegant? I could also pass a webhook to an external device, but since the MagTag is sleeping most of the time, I'd need to set up a separate device to parse the webhooks and maintain a list of alerts, which also seems inelegant.
Any thoughts?
Cool idea.
It sounds like this device wakes up on a schedule (or some other defined trigger)? And you want it to display the most recent HSM alert text?
Changed category to Developer Coding questions. You may get more appropriate eyes on it this way.
Is the data that you're wanting to view on the refrigerator device the same as the latest HSM "Notification" text that might be sent to your phone? If so, I have an idea.
Note sure if this will working with MakerAPI or not, but maybe worth a try:
- Add a Virtual "Notification" device to the hub. (Needs a driver to be written, as I am not aware of anyone having created one already.)
- Add this virtual notification device to HSM, just like you might add your phones.
- Use MakerAPI to read the 'notificationText' attribute, as it will contain the last notification message sent to it.
I haven't tried this, but I believe it should work...
I don't know if it will help but @thebearmay wrote a device driver that I use to put notifications on to one of my dashboards.
I don't see it in Hubitat Package Manager and I don't remember how I installed it. The last change listed in driver's code is December 2021 so it's been around a while. I created the device in March, 2022.
Try looking under Notification Tile...