Hello,
its me again with a YAML problem. Im a little confused about platforms and how to usem them e. g. for sensors.
I made a template sensor for my PV System and a second sensor should integrate the energy.
The first template sensor works well. Here is my template secotion:
template:
- sensor:
- name: einspeisung
unique_id: TEST1
device_class: power
state_class: measurement
unit_of_measurement: W
state: >
{% if states("sensor.tasmota_sm_16_7_0")|float > 0 %}
0
{% else %}
{{ states('sensor.tasmota_sm_16_7_0') | float}}
{% endif %}
- platform: integration
- name: einspeisung_int
state: on
# source: sensor.einspeisung
# unique_id: TEST2
#device_class: power
#state_class: measurement
#unit_of_measurement: W
# unit_prefix: Wh
# round: 2
I need to use the integration Platform for the second sensor.
The first question: I get an error it does not matter, if i placed it like this
template:
- sensor:
- name: firstSensor
...
- platform: integration # at this setup the "-" befor the platform, is displayed in black not red
- name: secondSensor
How do i have a integration sensor and one without integration ?
And the second question: If i add a third sensor under the second sensor, is the integral applied to it to ? How do i deactivate it for sensors that will come under the second one ?
Yes, this is right. Thank you for your fast reply.
Is it possibly to create (template) sensors in a sensor file ? I assumed that have to be under template, because they are not really exists … ?
There are many “sensors” in HA. They can be added by an integration if the product supports that. You can also build, or “template” your own sensors if that is required. Sensors are sometimes physical devices and other times they are derived or virtual devices where you create this sensors properties by "template"ing them.