Is it possible to create a new sensor let’s say sensor.tesla.car and populate it with states or attributes from different other sensors? So you’d get:
sensor. tesla.car
with attributes:
one
two
three
Which would populate from 3 different other sensors that already exist.
sensor. car.charge_level [state]
sensor.light.room [level attribute]
sensor.motion.outside [humidity attribute]
Did I make myself clear? I think I did. I can’t find this anywhere.
I know the template sensor supports attributes. But I want to take 3 or 4 attributes from 3 or 4 different sensors and create one new sensor with all these attributes in it.
So if I have a temp of 34 with a battery level of 56% and a motion sensor ON
Then i’d like to create a new sensor that has attributes [34, 56, ON]
Basically
For new sensors it is recommended that you use the new format.
configuration.yaml:
template:
- sensor:
- name: my new sensor
state: "OK" # you can also put a state template here
attributes:
attribute1: "{{ states('sensor.sensor1') }}"
attribute2: "{{ states('sensor.sensor2') }}"
attribute3: "{{ states('sensor.sensor3') }}"