All examples I’ve found look similar.
But I get the following error:
sensor.template: [source /config/esphome/nodemcu1.yaml:55]
platform: template
[sensors] is an invalid option for [sensor.template]. Please check the indentation.
sensors: [source /config/esphome/nodemcu1.yaml:57]
haWeatherTemp:
friendly_name: Temperatur von HomeAssistant
entity_id: weather.kelpi_haus
value_template: {{states.weather.kelpi_haus.attributes.temperature}}
[sensors] is an invalid option for [sensor.template]. Please check the indentation.
sensors: [source /config/esphome/nodemcu1.yaml:57]
haweathertemp:
friendly_name: Temperatur von HomeAssistant
entity_id: weather.kelpi_haus
value_template: {{states.weather.kelpi_haus.attributes.temperature}}
sensor: # how many times does this line appear in your config? Should be only once.
- platform: template
sensors:
haweathertemp:
friendly_name: "Temperatur von HomeAssistant"
entity_id: weather.myzone # no need for this it has been depreciated in v0.116, remove it, though this is most likely not your error. Should only generate a warning in the log.
value_template: "{{states.weather.myzone.attributes.temperature}}"
Wait. I completely missed that you are trying to use home assistant’s template sensor format in esphome. I thought you were making a home assistant template sensor. Despite esphome being in the title and tags. Sorry.
Yeah your config is completely wrong. You want this:
If you want to bring an attribute into esphome use what you had originally (with the corrections) in home assistant to create a sensor from the attribute. Then use this to bring it into ESPhome:
You have to do it that way because unfortunately this esphome sensor does not support attributes.
I’m about to go to bed. If you have trouble let me know and I’ll write it out some time tomorrow.
Thank you @tom_l
I scanned the esphome docs here and as far as I understand, there is no way to map all attributes from a HA sensor into ESPHome. We only can map 1 HA sensor attribute to one sensor in ESPHome. Correct?
That unfortunately really blows up coding as I want to show lots of information on local dashboard
Is it because your trying to use the actual attributes? Couldn’t you send the attribute values to a template sensor and then use them as individual sensors? I know that’s probably not ideal but you may be able to get what you want
Most of the questions asked on this forum have been answered here or elsewhere many times already. I also asked them a question and engaged in discourse. I was under the impression that was the purpose for these forums.