Hi all
I want to have a group, in which is my switch (TPLink) and the associated sensor information.
The code i have for the sensors is here
sensor:
# Weather prediction
- platform: yr
- platform: template
sensors:
my_tp_switch_pool_amps:
friendly_name_template: "{{ states.switch.Pool.name}} Current"
value_template: '{{ states.switch.Pool.attributes["current_a"] | float }}'
unit_of_measurement: 'A'
my_tp_switch_pool_watts:
friendly_name_template: "{{ states.switch.Pool.name}} Current Consumption"
value_template: '{{ states.switch.Pool.attributes["current_power_w"] | float }}'
unit_of_measurement: 'W'
my_tp_switch_pool_total_kwh:
friendly_name_template: "{{ states.switch.Pool.name}} Total Consumption"
value_template: '{{ states.switch.Pool.attributes["total_energy_kwh"] | float }}'
unit_of_measurement: 'kWh'
my_tp_switch_pool_volts:
friendly_name_template: "{{ states.switch.Pool.name}} Voltage"
value_template: '{{ states.switch.Pool.attributes["voltage"] | float }}'
unit_of_measurement: 'V'
my_tp_switch_pool_today_kwh:
friendly_name_template: "{{ states.Pool.name}} Today's Consumption"
value_template: '{{ states.switch.Pool.attributes["today_energy_kwh"] | float }}'
unit_of_measurement: 'kWh'
And my group config is here
group:
deck:
name: Deck
view: yes
entities:
- switch.DeckLights
pool:
name: Pool
view: yes
entities:
- switch.Pool
study:
name: Study
view: yes
entities:
- switch.MiniITX
How do i marry the two?
I want the “Study” view/group to have the switch for a miniITX system, and display on that page the output that is generated from the code in the sensor/template above.
I have done some googling, but couldnt seem to see the answer. And might not have my head around templates and if what i want to do is even possible.
Thanks!