Webcore (Feature Request) Device Notes

Now that we have a place to put device notes on our devices, it would be nice if webcorew could pull this info.

Reason: I have created a piston that checks daily for battery life on aeach device, I would like it that if device battery level is below X, that i can push a notification to my phone of what the device notes are, as I am storing Battery Type, Qty, and more into that field. this would make replacing batteries quicker for me.

You can do some form of that yourself. Make a piston that has a local string variable array. Since the arrays in Webcore are really maps, you can make an array with the device name as the key, and your notes for it as the value.

You can put that in a separate notifier piston, and call that piston from the battery check piston (or any other piston), and send the device name to it as a parameter. Then that piston finds the notes for that device name in the map, and it sends the notification with the info.

Would not want to stop the request from being developed, but perhaps as an alternative you could construct a link to the device detail page to include in the notification?

The issue is that notes is a not an attribute of the device but is a property of the device. Probably could pull it via an expression but would require a different construct than currently exists within the app, i.e. [deviceName.property : propertyName] vs the current [deviceName:attributeName]

1 Like

:point_up: What he said.... :slight_smile:

1 Like

Then I am storing info in 2 places and have to maintain in 2 places. Maybe we can see if hubitat will make notes as an attribute, I mean it took 2 years from when I requested the notes section before it was added, but hey it eventually was so who knows.

They could just add notes to the Maker API device info, and it could be parsed out from there. I don't see it currently included though.

Can you elaborate on this some, I might make this work for me. Just never made a piston with variables and pulled them across to another piston

You are really sending values for the arguments that the receiving piston accepts. The limitation is you cannot send arrays as arguments for the receiving piston.

Sending Piston:

Set a local variable of whatever type.

Add an Action
Add a task to location
Select Execute Piston
Piston Value: is a drop down of your pistons to choose which one to execute
Argument: Select Variable, then choose your variable from the dropdown. You can choose multiple variables to send, and they can be a global variables as well.

Wait for Execution: Usually false, as there is no real reason to wait for the executed piston to finish before continuing on with the current piston. They point out that you cannot use a global variable as a way to get a "return value" from the executed piston

Then click "Add" and you will get this:

Receive Piston:

Set a local variable to receive the argument:
I use the same name as the sending piston. I don't think it has to be, though
Initial Value: is the name of the variable that was sent from the other piston

When the piston runs, all argument variables in the receiving piston will have the values sent.

1 Like

Thanks, Never tried that before Sounds like I have some fun to try

It is good as a way to reuse code. If you have several pistons doing the same task, just move that task to a common piston that both of them can call.