Requesting recommendations and assistance using the RESTful sensor. I’ve reviewed the RESTful docs and am struggling with understanding and how to use this. I’m not a developer or programmer but am familiar with HA used with an RPi 3 & 4.
I have an optical sensor that counts people. It is capable to count adults and children entering and exiting. The typical application is mounting the sensor overhead above a doorway and count people entering and exiting. The sensor has an API that I generate and online developer documentation available if you have account log in credentials.
Attached are three screenshots from the online documentation related to the url needed but I’m not understanding how to craft the yaml language in HA. For now I’m mainly interested in the counting and once I can understand how to get this working I will monitor other attributes.
Try it using the new rest integration. You can create many sensors from the one call to the resource with this. Unlike the restful platform that requires a call for each of the sensors you create. This will cut down the chance of any API limit being exceeded or reduce your need to create template sensors if you grab all the measurements at once as attributes.
You need to add the device id in the resource and put your key in the headers:
Paste your example data in the left hand column and drill down to the measurement you want in the right hand column. The path is at the top of the right hand column (replace “x” with “value_json”).
I don’t believe the one call to the source is viable since there are already many DEVICE_ID’s created that are used in other aspects. Therefore, the DEVICE_ID and KEY would be required for each optical sensor which has it’s own ability to count adults entering and exiting.
The device (optical sensor in this case) already has these four attributes of counting adults and children and I believe it’s needed to call for a count at a given interval (scan_interval) in order to update the count as needed.
Each DEVICE_ID has it’s own API_KEY with these four attributes and more but for now the only interest is the counting aspect.
It’s my understanding if I can get one DEVICE_ID with its API_KEY working then I should be able to get the four counting attributes and then display these counts.