Hello,
I am just starting with HA and I am trying to integrate my custom radiator controller (Pilot Wire) that is based on a Shelly Plus 2PM + Two Diodes connected to each output.
Depending on the combination On/Off of each channels it defines the actual radiator modes.
I have managed to display the current modes (pilote_salon_front_mode
), but now I would like to have a more user friendly way of setting the the modes from the UI.
Question / Help:
Using the mode selector (pilote_salon_front_setmode
), if I select any of the given modes how could I set / send the corresponding combination of On or Off the the channels.
How would the below pseudo code
look like or is this kind of thing even possible?
template:
- sensor:
- name: "Pilote - Salon - Front - Mode"
unique_id: pilote_salon_front_mode
state: >
{% if is_state('switch.shelly_pm_pilote_salon_switch_0', 'on') and is_state('switch.shelly_pm_pilote_salon_switch_1', 'off') %}
off
{% elif is_state('switch.shelly_pm_pilote_salon_switch_0', 'off') and is_state('switch.shelly_pm_pilote_salon_switch_1', 'off') %}
on
{% elif is_state('switch.shelly_pm_pilote_salon_switch_0', 'on') and is_state('switch.shelly_pm_pilote_salon_switch_1', 'on') %}
eco
{% elif is_state('switch.shelly_pm_pilote_salon_switch_0', 'off') and is_state('switch.shelly_pm_pilote_salon_switch_1', 'on') %}
anti-freeze
{%- else -%}
unknown
{%- endif %}
- select:
- name: "Pilote - Salon - Front - SetMode"
unique_id: pilote_salon_front_setmode
state: "{{ states('sensor.pilote_salon_front_mode') }}"
options: "{{ ['off', 'on', 'eco', 'anti-freeze'] }}"
select_option:
<<HELP -- PESEUDO CODE>>
if pilote_salon_front_setmode == 'on':
- service: switch.turn_off
target:
entity_id: switch.shelly_pm_pilote_salon_switch_0
- service: switch.turn_off
target:
entity_id: switch.shelly_pm_pilote_salon_switch_0
if pilote_salon_front_setmode == 'echo':
- service: switch.turn_on
target:
entity_id: switch.shelly_pm_pilote_salon_switch_0
- service: switch.turn_on
target:
entity_id: switch.shelly_pm_pilote_salon_switch_1
<<HELP -- PESEUDO CODE>>
Thanks in advance for any help or suggestions,