I have some sensors created by RestAPI posts to HA. I am finding that I cannot get friendly_name to work against these sensors.
I am assuming it is because these sensors effectively don’t exist on restart until they post again.
Does anyone have any idea on how to get around this?
I have done the template sensor thing but ideally I would like the original sensor due to the extra information available when viewing this sensor from the fronted, it just looks nicer
Can you share what you’re sending? You should definitely be able to set friendly_name. Basically you’re creating what is called an HTTP Sensor. I just tried it, creating a sensor called sensor.test (which didn’t otherwise exist), and it worked fine:
Here is what I sent (with sensitive data redacted):
curl -X POST -H "Content-Type: application/json" -d '{"state": "20", "attributes": {"friendly_name": "Test Test Test"}}' https://IP:8123/api/states/sensor.test -H "Authorization: Bearer XXXXXX"