Create sensors and set state with REST api

Hi All,

I’m trying to push some data trough the REST API to some random sensors.

I have an alarm panel that can push JSON to a rest API, but i somehow need to convert this data to set the state of several sensors. Can this be done? I tried setting state for a random sensor, but all i get is a random number for the state, not my value, although I get a 200 ok if i set the state to “alarm”. Even i i do a HTTP GET for this same sensor, it returns “alarm” as its state, but i the GUI is still just see a random number as state.

Seems the random sensor states gets it state changed on a regular interval. I

I need about 20 alarm sensors that only have its state changed by the alarmpanel posting data to HA. So everything (all attributes and state) should only be set by my posts.

What kind of sensor do I need for this and is this even possible?

edit: Nevermind, found the HTTP sensor :slight_smile:

Easier to use a rest sensor and a template, rather than configure your alarm panel to do the work I guess

Well, The panel pushes the info if anything changes, so no need to keep polling it constantly from HA with a REST sensor…

Sure, if that’s the way you want to go checkout the API docs.
This might be useful too.

Last time I checked there is no nice way to parse json from a sensors state, which otherwise is the obvious thing to try