I’m using IPMA component https://www.home-assistant.io/components/weather.ipma/ and it creates a card like this:
I would like to get the temperature and show it with other temperature data on history, here:
How can I achieve this?
Thank you
I’m using IPMA component https://www.home-assistant.io/components/weather.ipma/ and it creates a card like this:
How can I achieve this?
Thank you
You can use a template sensor that references the attribute of your weather component to achieve that. You’ll want to confirm the entity_id of your weather component and that the temperature attribute is named temperature.
Here’s an example of what I would need based on my weather component:
sensor:
- platform: template
sensors:
weather_temperature:
friendly_name: "Weather Temperature"
unit_of_measurement: 'degrees'
value_template: "{{ state_attr('weather.local_weather', 'temperature') }}"
It says “See dev-info panel for details.” What additional information about the error is reported there?
It would be helpful to know the details of the error because I created a similar template_sensor and it passed the configuration check.
test_sensor:
friendly_name: "Just a test"
unit_of_measurement: 'degrees'
value_template: "{{ state_attr('climate.thermostat', 'temperature') }}"
I’m at a loss to explain how that error message has anything to do with adding a simple template_sensor.
If you remove the template_sensor from the configuration file and restart Home Assistant, does the same error message still appear?
“There are no new issues!” if I remove the template_sensor :s
Is weather_temperature
the only template_sensor in your configuration or are there other ones in there already?
This how the template_sensor should be entered into your configuration file. It should be part of the existing sensor:
section.
# Sensors
sensor:
# Weather prediction
- platform: yr
name: Weather
monitored conditions:
- temperature
- symbol
- platform: template
sensors:
weather_temperature:
friendly_name: "IPMA"
unit_of_measurement: 'degrees'
value_template: "{{ state_attr('weather.porto', 'temperature') }}"
# Text to speech
tts:
platform: google
Just try changing the name to something else, like weather_temperature_2.
It is working, thank you. I’ll read the documentation next weekend to understand the config.yaml structure.
You’re welcome! Have fun with Home Assistant.
One more question that I think is related. I would like that this sensor is shown alongside other temperature sensors however it has it’s own plot.
I change the settings to the following:
But it doesn’t make any change on history.
Not sure, but maybe the unit of measurement for already logged sensor data doesn’t change in the database. You could try changing the name of the sensor again so that Home Assistant sees it as a new sensor with the correct type and unit.
You marked “Change the name to something else” as the Solution to the original problem?
@Brett_C is the person who supplied the solution to create a template_sensor.
I helped you enter it correctly into your configuration file and @tjntomas helped you correct the name (because you already had a sensor with the same name). Basically, we pitched in to help you implement Brett’s solution.
For the benefit of other people who may encounter the same problem, please attribute the solution to Brett’s post.
As for the graph, once the recorder starts logging the entity, you’ll either have to purge the database (and lose all your existing data) or follow tjnthomas’s suggestion and rename the sensor, yet again, to force the recorder to log it with the new parameters. The old data, for sensor.weather_temperature2
, will persist in the database (and appear in the graph) until it expires (typically in 7 days or whatever period of time you may have specified).
you’re right.
Is 7 days the default? How do I make my data there forever?
You can set the purge_interval in the recorder configuration to 0. If not, the recorder database is purged daily, keeping only the last 10 days. To keep the db size down, you can also list the the entities that you want to record. See here https://www.home-assistant.io/components/recorder/.