I’m back to HASS after a long time away and trying to get into slightly more advanced setups. I’m attempting to setup a REST sensor using the documentation but putting the simple sample code into configuration.yaml, saving and reloading… nothing happens. The sensor does not appear in the entities list, it doesn’t show anything in the logbook, and there is nothing in home-assistant.log
I presume I’m missing something simple, so I was hoping someone could direct me at a tutorial for using sensors or specifically REST sensors, that they’d recommend.
Thanks, I didn’t see that tip or it didn’t click because I was just trying to complete the simple exercise of learning how to use a single basic REST sensor. Doesn’t answer the my issue in the end.
The answer to my problem was not that I was doing anything wrong, but the documentation lacks a critical piece of information: You must FULLY restart HASS, not reload the config.
New sensors will only be picked up on HASS restart. Once it’s already up and running you can change some aspects of the sensor (I didn’t test how much, but some settings like scan_interval worked) via a config reload.
Perhaps rethink how you communicate on the forum. You asked two questions, and I answered the one that I had an answer to. Getting annoyed isn’t going to get you far around here. If you didn’t want an answer to that question you shouldn’t have asked it — and especially not sound like you’re blaming the person trying to help.
That’s not exactly true. Now that you have the domain set up in configuration.yaml, you can add new REST sensors and change or delete existing ones; and see the changes with a YAML reload rather than a restart.
You only needed to restart because you were adding a top-level domain into the configuration.
You don’t need to restart the computer, but you do need to “Restart Home Assistant”. As others have pointed out, only when adding that first REST sensor. After that a reload should be sufficient.
Were you just doing a YAML reload? I’ve been successful in just executing a reload through Developer Tools->Services->RESTful: Reload without restarting.
You need to restart HASS if its the first time you’re adding any integration (in this case REST/RESTFUL). Once you’ve got that rest: line in and restarted HASS once, then after that you can just do a reload.
Can you assist with this code, if possible, i am having an issue trying to add this sensor code into HA, I try where sensor.yaml & configure.yaml but not able to see the see sensor for the airtag expose into HA
There are many other ways to edit yaml, notepad++ is also fine. But please read the linked topic on how to properly post your yaml on the forum. If you don’t, we only see a jumbled mess.
CLICK ON THE LINK ABOVE AND READ IT. It’s not just about not being a helpdesk. Section 11 (the link) is about formatting code. The way you have posted it makes it unreadable and we cannot help you until you correct it.
I, and I’m sure others, would be more than happy to help once we have your code in a state that we can read.
We need it to look like this:
- platform: rest
name: airtag
and so on.
Do this by putting three backticks before and after the code:
Is there a way of concatenating part of an IP address with the current year for the rest resource? It works as a template but is not picking up in the rest sensor. The resource is https://aa.usno.navy.mil/api/seasons?year=[current year], so https://aa.usno.navy.mil/api/seasons?year=2024 but I want to automatically update the year.
I tried below but no success.