I no longer have access to my brothers login to test but reading above and looking at documentation, seems like channels can’t be set but rather you can cycle through channel modes or use favourites.
Using a lovelace button ) Insert ‘Manual’ and paste code below you might be able to use this button to cycle modes and have a button per channel to cycle by changing the device_number: for each channel
type: button
tap_action:
action: call-service
service: rest_command.poolaction
service_data:
action_code: 1
device_number: 1
target: {}
name: Jet 1 - Cycle Mode
icon: mdi:water-plus
or could use an input select in lovelace alongside the button
type: button
tap_action:
action: call-service
service: rest_command.poolaction
service_data:
action_code: 1
device_number: {{ states('input_select.channelnumber') }}
target: {}
name: Channel Mode - Cycle
icon: mdi:reload
Could go a step further but will require you to add a sensor for each channel and then potentially show the status in the ‘name’ in above to include {{ states(‘sensor.pool1_channels0_mode’) }}
e.g.
type: button
tap_action:
action: call-service
service: rest_command.poolaction
service_data:
action_code: 1
device_number: 1
target: {}
name: "Channel Jet 1 - ({{ states('sensor.pool1_channels0_mode') }})"
icon: mdi:water-plus
e.g. for adding a new channel per sensor - keeping in mind the number between [] e.g. [0] or [1] is the array index ID and not the channel number
pool1_channels0_mode:
friendly_name: Pool - Channel 0 Mode
value_template: >-
{{ ['Off', 'Auto', 'On', 'Low Speed', 'Medium Speed', 'High Speed'][states.sensor.pool_status.attributes["channels"][0]["mode"]|int] }}
pool1_channels1_mode:
friendly_name: Pool - Channel 1 Mode
value_template: >-
{{ ['Off', 'Auto', 'On', 'Low Speed', 'Medium Speed', 'High Speed'][states.sensor.pool_status.attributes["channels"][1]["mode"]|int] }}
Rather than using array ID you might be able to use channel id in sensor by changing to something like
pool1_channels0_mode:
friendly_name: Pool - Channel 1 Mode
value_template: >-
{{ ['Off', 'Auto', 'On', 'Low Speed', 'Medium Speed', 'High Speed'][states.sensor.pool_status.attributes.channels[?(@.channel_number == "1")]["mode"]|int] }}
pool1_channels1_mode:
friendly_name: Pool - Channel 2 Mode
value_template: >-
{{ ['Off', 'Auto', 'On', 'Low Speed', 'Medium Speed', 'High Speed'][states.sensor.pool_status.attributes.channels[?(@.channel_number == "2")]["mode"]|int] }}
EDIT: Thinking about the above some more there might be a 30-60 second delay between showing the channel status 'e.g. Low Speed after pressing it though this line from the manual sounds promising Note after an instruction has been sent all API calls are not time throttled for a period of 5 minutes.
If I understand that correctly when a poolaction is sent none of the API are throttled for 5 minutes so you could add an update sensor on press like under the switch examples at the top of the thread, e.g. (if tap action buttons support it, add):
- service: homeassistant.update_entity
entity_id: sensor.pool_status
What would be ideal is to call the above (homeassistant.update_entity
for sensor.pool_status
) every time rest_command.poolaction
is called. I believe a HA script would allow you to do this and then call the script which calls the restcommand and update… or using a switch: for channel like (valves and heaters) which is probably the simplest but make it momentary e.g. put this in your switch.yaml file or in configuration.yaml under switch: (where you valve, heater and light switchers are):
#########################################
####### ASTRAL POOL CHANNEL1 TOGGLE #####
#########################################
- platform: template
switches:
pool_channel1:
value_template: >
{% if is_state('switch.pool_channel1','on') %}
off
{% endif %}
unique_id: 81343ccd1e79-82ccsds2ae276
friendly_name: "Channel 1 (Jets) - {{ states('sensor.pool1_channels0_mode') }}"
turn_on:
- service: rest_command.poolaction
data:
action_code: 1
device_number: 1
- delay: 1
- service: homeassistant.update_entity
entity_id: sensor.pool_status
turn_off:
PS> As mentioned above, this is untested as I no longer have access to the connectmypool.com.au portal