jascdk
(Jascdk)
June 23, 2019, 9:56pm
1
Hi:)
I tried to search the forum for examples for this, but I got nothing to work:(
The case is:
I have an heatpump, which is able to send and get MQTT messages.
I would like to make an input select option to choose which mode it should be in.
The topics are:
state_topic: "b4e62d65a99f/HP/2201"
command_topic: "b4e62d65a99f/HP/SET/2201"
The payloads are:
0.00 (refers to Off)
1.00 (refers to Auto)
4.00 (refers to Hot Water Only)
How should I put together a input select and automation to work bidirectional?
Regards
Jacob
Thereās an example for bidirectional manner in the docs .
jascdk
(Jascdk)
June 24, 2019, 7:27am
3
Thanks:) I got that up and running now.
How do I then set/publish the payloads 0.00 1.00. and 4.00 when switching the input selector? Can I make one automation for this or do I need to make an automation for each payload - and would this be biderectional also?
Itās also in the docs.
Read the last (Set Thermostat Mode) example.
jascdk
(Jascdk)
June 24, 2019, 6:26pm
5
Well I got it to work now - sort of.
But is there not a way to simplify the automation instead of splitting it up, like I did here?
input_select:
heatpump_mode:
name: Heatpump Mode
options:
- "Off"
- "Auto"
- "Varmt Vand"
icon: mdi:target
automation:
- alias: Set Heatpump Mode Selector
trigger:
platform: mqtt
topic: "heatpump/mode"
action:
service: input_select.select_option
data_template:
entity_id: input_select.heatpump_mode
option: "{{ trigger.payload }}"
- alias: Set Thermostat Mode
trigger:
platform: state
entity_id: input_select.heatpump_mode
action:
service: mqtt.publish
data_template:
topic: "heatpump/mode"
retain: true
payload: "{{ states('input_select.heatpump_mode') }}"
- alias: Heatpump Mode Off
trigger:
platform: state
entity_id: input_select.heatpump_mode
to: 'Off'
action:
- service: mqtt.publish
data:
topic: "b4e62d65a99f/HP/SET/2201"
payload: "0.00"
- alias: Heatpump Mode Auto
trigger:
platform: state
entity_id: input_select.heatpump_mode
to: 'Auto'
action:
- service: mqtt.publish
data:
topic: "b4e62d65a99f/HP/SET/2201"
payload: "1.00"
- alias: Heatpump Mode Varmt Vand
trigger:
platform: state
entity_id: input_select.heatpump_mode
to: 'Varmt Vand'
action:
- service: mqtt.publish
data:
topic: "b4e62d65a99f/HP/SET/2201"
payload: "4.00" `Preformatted text`