Here’s my /homeassistant/configuration.yaml code, however I can’t find the device/entity with the name “External IP”. Restarted/reloaded HASS multiple times but nothing happens. What am I missing?
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
# Custom code here
sensor:
- platform: rest
resource: http://ip.jsontest.com
name: External IP
value_template: "{{ value_json.ip }}"
scan_interval: 120
Yes, configuration.yaml, fixed the typo in the post.
Here’s what I assume it’s relevant from the logs: Platform rest not ready yet: [Errno -5] Name has no usable address; Retrying in background in 30 seconds
Looks like I believe that I had to surround the name with quotes as it’s working now. I believe that the documentation RESTful Sensor - Home Assistant has to be updated?
Do you really need to check every two minutes? Might get banned from the API for too many requests…
You are also relying on the order of the JSON list. Perhaps you could look up your area so that you get the correct forecast even if the list order changes. For the temperature, for example:
With the Rest integration, it doesn’t matter as you are only making one API call.
The advantage of separate sensors with individual states is that you can assign units of measurement, and track history easily. Attributes are more fiddly to work with.
Alternatively, you could use this to create a proper weather entity: