Rest Sensor receiving JSON - Astralpool - connectmypool.com.au

Not via connectmypool, I’m afraid. Having said that, I can connect to my chlorinator via bluetooth, so if that’s the case for you then maybe you could get other info via that eg I managed to get info from my shaver - here.

Separately if this is a constant issue for you, I’d suggest also looking to see if there is a way to put in a sensor that alerts you if the water drops below a certain level. Not an issue for me as, well, Melbourne. :wink:

I’m thinking a flow meter might be the go. It’s not necessarily just low water, it could also be the skimmer being blocked

Oh, and FYI check out this: Viron Astral Pool ChlorinatorGo integration - #86 by pbutterworth

I’ll have to doublecheck but I don’t think mine has the bluetooth integration.

Can check by seeing if there is something claiming to be POOL01 or similar when you look for bluetooth devices with your mobile. You could always note down the actual model number of your device and check online, or go into settings of the chlorinator and see if you can find the bit that says “Bluetooth Access Code” - in my case it’s a four character mix of alphanumerics. Just for the heck of it I setup an esp32 with ble on it, put that near my chlorinator and installed the HACS code and after a while the sensors became populated. Doesn’t tell me a lot more than what I get from connectmypool but what the hey.

Yeah, found that it is Bluetooth. Just waiting for an ESP device to arrive. My HA is too far away for Bluetooth direct

Got it working finally! Seems much more reliable than the scrape. Would be nice if you could see the actual ORP reading though. Don’t know if it is possible through either the bluetooth or scraping the ConnectMyPool site but it would be also good to see things like timers or if the acid pump is running (dosing)

I recall seeing somewhere that there may be a ‘hidden’ way of turning on the actual reading by hitting a special sequence of keys on the chlorinator, but may be firmware dependant. Will have a hunt and if I find anything I’ll come back.

Need to go into the install menu and change the setting from NO to YES. Was in page 14 of the manual… Who knew…

1 Like

Was already on for me. I reckon that is to display on the screen (which mine does) as opposed to exposing it to bluetooth

Dang. Ah well.

I can 100% confirm that the EQ does not spit out ORP over bluetooth.
It does send:
self.highest_orp_measured
self.lowest_orp_measured
And there is a flag to ResetStatistics
So I tried to get HA to routinely reset statistics, and read those measurements, but all I ever got was useless info.

Speaking of dang, the most recent update to HA has required moving things out of “- platform: template” - it is only complaining at the moment but eventually it will break things.

So instead of:

  - platform: template
    sensors:
      pool1_ph_status:
        friendly_name: Pool - pH
        value_template: '{{ states.sensor.pool_scrape.attributes["pH"] }}'
        unit_of_measurement: 'pH'

You need something like:

  template: 
     - sensor:
        - name: Pool - pH
          unit_of_measurement: pH
          default_entity_id: sensor.pool1_ph_status
          state: '{{ states.sensor.pool_scrape.attributes["pH"] }}'
        - name: Pool - Current Temperature
          device_class: TEMPERATURE
          unit_of_measurement: °C
          default_entity_id: sensor.pool1_temperature
          state: '{{ states.sensor.pool_status.attributes["temperature"] }}'

Etc. Kind of a pain to go through everything (I had well over 60 entities I needed to change), but it is what it is. FWIW I have all my templated entities in a separate template.yaml file, called from configuration.yaml by adding in:

template: !include template.yaml

Obviously, before modifying anything, make sure that you take a copy of the original .yaml files and after editing you go into developer tools in the GUI and run ‘check configuration’ before restarting. It is incredibly easy to make an accidental change (my bad habit is not holding the shift key down long enough and typing “3” rather than “#” when commenting out lines) that then breaks HA.

Curious, I thought I would take the plunge and update my templates as pointed out by @zagnuts double checked them all they seem correct but now everything is broken lol looks like its the rest_command thats the issue


I didn’t touch this at all… i even tried reverting back to the backup i took just incase and getting the same issue… anyone else having this issue?

Sorry for double post… looks like I was just being stupid and didnt do the templates correct…
I’ve updated all the templates to the new format (the ones provided at the start anyway.

template:
  - sensor:
      - name: Pool - Pool Spa Selection
        state: >
          {{ ['Spa', 'Pool'][state_attr('sensor.pool_status', 'pool_spa_selection') | int] }}
      - name: Pool - Current Temperature
        device_class: temperature
        unit_of_measurement: "°C"
        state: '{{ states.sensor.pool_status.attributes["temperature"] }}'
      - name: Pool - Active Favourite
        state: '{{ states.sensor.pool_status.attributes["active_favourite"] }}'
      - name: Pool - Heater Mode
        state:   >-
          {{ ['Off', 'On'][states.sensor.pool_status.attributes["heaters"][0]["mode"]|int] }}
      - name: Pool - Heater set temperature
        device_class: temperature
        unit_of_measurement: °C
        state:   >-
          {{ states.sensor.pool_status.attributes["heaters"][0]["set_temperature"]|int }}
      - name: Pool - Spa heater set temperature
        device_class: temperature
        unit_of_measurement: °C
        state:  >-
            {{ states.sensor.pool_status.attributes["heaters"][0]["spa_set_temperature"]|int }}
      - name: Pool - Solar System Mode
        state:  >-
          {{ ['Off', 'Auto', 'On'][states.sensor.pool_status.attributes["solar_systems"][0]["mode"]|int] }}
      - name: Pool - Solar System Set Temp
        device_class: temperature
        unit_of_measurement: °C
        state:  >-
          {{ states.sensor.pool_status.attributes["solar_systems"][0]["set_temp"]|int }}
      - name: Pool - Current Channel Mode
        state:  >-
          {{ ['Off', 'Auto', 'On', 'Low Speed', 'Medium Speed', 'High Speed'][states.sensor.pool_status.attributes["channels"][0]["mode"]|int] }}
      - name: Pool - Valve Mode
        state:   >-
          {{ ['Off', 'Auto', 'On'][states.sensor.pool_status.attributes["valves"][0]["mode"]|int] }}
      - name: Pool - Light Status
        state:   >-
          {{ ['Off', 'Auto', 'On'][states.sensor.pool_status.attributes["lighting_zones"][0]["mode"]|int] }}

So, blame me then. :rofl:

Seriously, it was indeed a right pain in the proverbial but I have everything working again. The thing that tricked me initially was after updating the templates the devices/switches changed so I had to update my automations to point to the new devices.

haha well if i get the chance to blame someone else god damn it i’m going to take that opportunity.

I’m not sure where i stuff mine up originally… I guess when in doubt, purge the lot and start again lol hopefully we doing all the templates above will help some people out.

1 Like

Actually speaking of this, can you show me one of your automations? mine are still broken when trying to use ‘rest_command.poolaction’

Heh. Fair enough. FWIW I found using the ‘unique ID’ helps eg here is the horror (I do need to tidy it up a bit) that is extracted from my template.yaml file:

- sensor:
    - name: Pool - Heat Cool Selection
      unique_id: sensor.pool1_heat_cool_selection
      state: '{{ [''Cooling'', ''Heating''][states.sensor.pool_status.attributes["heat_cool_selection"]|int]
        }}'

    - name: Pool - Current Temperature
      device_class: TEMPERATURE
      unit_of_measurement: °C
      unique_id: sensor.pool1_temperature
      state: '{{ states.sensor.pool_status.attributes["temperature"] }}'

    - name: Pool - Active Favourite
      #default_entity_id: sensor.pool1_active_favourite
      unique_id: pool_active_favourite
      state: '{{ states.sensor.pool_status.attributes["active_favourite"] }}'

    - name: Pool - Gas Heater Mode
      unique_id: sensor.pool1_heaters0_mode
      state: '{{ [''Off'', ''On''][states.sensor.pool_status.attributes["heaters"][0]["mode"]|int]
        }}'

    - name: Pool - Gas Heater set temperature
      device_class: TEMPERATURE
      unit_of_measurement: °C
      unique_id: sensor.pool1_heaters0_settemp
      state: '{{ states.sensor.pool_status.attributes["heaters"][0]["set_temperature"]|int
        }}'

    - name: Pool - Heat Pump Mode
      unique_id: sensor.pool1_heaters1_mode
      state: '{{ [''Off'', ''On''][states.sensor.pool_status.attributes["heaters"][1]["mode"]|int]
        }}'

    - name: Pool - Heat Pump set temperature
      device_class: TEMPERATURE
      unit_of_measurement: °C
      unique_id: sensor.pool1_heaters1_settemp
      state: '{{ states.sensor.pool_status.attributes["heaters"][1]["set_temperature"]|int
        }}'

    - name: Pool - Filter Mode
      unique_id: sensor.pool1_channels0_mode
      state: '{{ [''Off'', ''Auto'', ''On'', ''Low Speed'', ''Medium Speed'', ''High
        Speed''][states.sensor.pool_status.attributes["channels"][0]["mode"]|int] }}'

    - name: Pool - Booster Mode
      unique_id: sensor.pool1_channels1_mode
      state: '{{ [''Off'', ''Auto'', ''On'', ''Low Speed'', ''Medium Speed'', ''High
        Speed''][states.sensor.pool_status.attributes["channels"][1]["mode"]|int] }}'

    - name: Pool - Swimjet1 Mode
      unique_id: sensor.pool1_channels6_mode
      state: '{{ [''Off'', ''Auto'', ''On'', ''Low Speed'', ''Medium Speed'', ''High
        Speed''][states.sensor.pool_status.attributes["channels"][2]["mode"]|int] }}'

    - name: Pool - Swimjet2 Mode
      unique_id: sensor.pool1_channels7_mode
      state: '{{ [''Off'', ''Auto'', ''On'', ''Low Speed'', ''Medium Speed'', ''High
        Speed''][states.sensor.pool_status.attributes["channels"][3]["mode"]|int] }}'

    - name: Pool - Light Status
      unique_id: sensor.pool1_light_status
      state: '{{ [''Off'', ''Auto'', ''On''][states.sensor.pool_status.attributes["lighting_zones"][0]["mode"]|int]
        }}'

    - name: Pool - pH
      unit_of_measurement: pH
      unique_id: sensor.pool1_ph_status
      state: '{{ states.sensor.pool_scrape.attributes["pH"] }}'

    - name: Pool - ORP Status
      unique_id: sensor.pool1_orp_status
      state: '{{ states.sensor.pool_scrape.attributes["ORP_Status"] }}'

    - name: Pool - ORP Set Point
      unit_of_measurement: mV
      unique_id: sensor.pool1_orp_setpoint
      state: '{{ states.sensor.pool_scrape.attributes["ORP_SetPoint"] }}'

    - name: Pool - pH Last Update
      unique_id: sensor.pool1_lastupdate
      state: '{{ states.sensor.pool_scrape.attributes["LastUpdate"] }}'

    - name: Pool - pH Last Scrape
      unique_id: sensor.pool1_lastscrape
      state: '{{ as_timestamp(state_attr(''automation.parsehub_run_pool_scrape'', ''last_triggered''))
        | timestamp_custom(''%A @ %-I:%M %p'') }}'

- switch:
  - name: Pool Favourite Filter only
    state: '{{ is_state(''sensor.pool1_active_favourite'', ''2'') }}'
    unique_id: switch.pool_fave_filter
    turn_on:
      - data:
          action_code: 8
          device_number: 2
        action: rest_command.poolaction
      - delay: 0:00:02
      - entity_id:
        - sensor.pool_status
        action: homeassistant.update_entity
    turn_off:
      - data:
          action_code: 8
          device_number: 255
        action: rest_command.poolaction
      - delay: 0:00:02
      - entity_id:
        - sensor.pool_status
        action: homeassistant.update_entity
  - name: Pool Favourite Filter and Heatpump
    state: '{{ is_state(''sensor.pool1_active_favourite'', ''3'') }}'
    unique_id: switch.pool_fave_filterheat
    turn_on:
      - data:
          action_code: 8
          device_number: 3
        action: rest_command.poolaction
      - delay: 0:00:02
      - entity_id:
        - sensor.pool_status
        action: homeassistant.update_entity
    turn_off:
      - data:
          action_code: 8
          device_number: 255
        action: rest_command.poolaction
      - delay: 0:00:02
      - entity_id:
        - sensor.pool_status
        action: homeassistant.update_entity    
  - name: Pool Favourite All Auto
    unique_id: switch.pool_fave_allauto
    state: '{{ is_state(''sensor.pool1_active_favourite'', ''129'') }}'
    turn_on:
      - data:
          action_code: 8
          device_number: 129
        action: rest_command.poolaction
      - delay: 0:00:02
      - entity_id:
        - sensor.pool_status
        action: homeassistant.update_entity
    turn_off:
      - data:
          action_code: 8
          device_number: 255
        action: rest_command.poolaction
      - delay: 0:00:02
      - entity_id:
        - sensor.pool_status
        action: homeassistant.update_entity

  - name: Pool Favourite All Off
    unique_id: switch.pool_fave_alloff
    state: '{{ is_state(''sensor.pool1_active_favourite'', ''128'') }}'
    turn_on:
      - data:
          action_code: 8
          device_number: 128
        action: rest_command.poolaction
      - delay: 0:00:02
      - entity_id:
        - sensor.pool_status
        action: homeassistant.update_entity
    turn_off:
      - data:
          action_code: 8
          device_number: 255
        action: rest_command.poolaction
      - delay: 0:00:02
      - entity_id:
        - sensor.pool_status
        action: homeassistant.update_entity

  - name: Pool Filter Switch
    unique_id: switch.pool_filter
    state: '{{ is_state(''sensor.pool1_channels0_mode'', ''On'') }}'
    turn_on:
      - data:
          action_code: 1
          device_number: 0
        action: rest_command.poolaction
      - delay: 0:00:02
      - entity_id:
        - sensor.pool_status
        action: homeassistant.update_entity
    turn_off:
      - data:
          action_code: 1
          device_number: 1
        action: rest_command.poolaction
      - delay: 0:00:02
      - entity_id:
        - sensor.pool_status
        action: homeassistant.update_entity

  - name: Pool Booster Switch
    unique_id: switch.pool_booster
    state: '{{ is_state(''sensor.pool1_channels1_mode'', ''On'') }}'
    turn_on:
      - data:
          action_code: 1
          device_number: 1
        action: rest_command.poolaction
      - delay: 0:00:02
      - entity_id:
        - sensor.pool_status
        action: homeassistant.update_entity
    turn_off:
      - data:
          action_code: 1
          device_number: 1
        action: rest_command.poolaction
      - delay: 0:00:02
      - entity_id:
        - sensor.pool_status
        action: homeassistant.update_entity

  - name: Pool Swimjet1 Switch
    unique_id: switch.pool_jet1
    state: '{{ is_state(''sensor.pool1_channels6_mode'', ''On'') }}'
    turn_on:
      - data:
          action_code: 1
          device_number: 6
        action: rest_command.poolaction
      - delay: 0:00:02
      - entity_id:
        - sensor.pool_status
        action: homeassistant.update_entity
    turn_off:
      - data:
          action_code: 1
          device_number: 6
        action: rest_command.poolaction
      - delay: 0:00:02
      - entity_id:
        - sensor.pool_status
        action: homeassistant.update_entity

  - name: Pool Swimjet2 Switch
    unique_id: switch.pool_jet2
    state: '{{ is_state(''sensor.pool1_channels7_mode'', ''On'') }}'
    turn_on:
      - data:
          action_code: 1
          device_number: 7
        action: rest_command.poolaction
      - delay: 0:00:02
      - entity_id:
        - sensor.pool_status
        action: homeassistant.update_entity
    turn_off:
      - data:
          action_code: 1
          device_number: 7
        action: rest_command.poolaction
      - delay: 0:00:02
      - entity_id:
        - sensor.pool_status
        action: homeassistant.update_entity

  - name: Pool Gas Heater Switch
    unique_id: switch.pool_gas
    state: '{{ is_state(''sensor.pool1_heaters0_mode'', ''On'') }}'
    turn_on:
      - data:
          action_code: 4
          device_number: 1
          value: 1
        action: rest_command.poolaction
      - delay: 0:00:02
      - entity_id:
        - sensor.pool_status
        action: homeassistant.update_entity
    turn_off:
      - data:
          action_code: 4
          device_number: 1
          value: 0
        action: rest_command.poolaction
      - delay: 0:00:02
      - entity_id:
        - sensor.pool_status
        action: homeassistant.update_entity

  - name: Pool Electric Heater Switch
    unique_id: switch.pool_heatpump
    state: '{{ is_state(''sensor.pool1_heaters1_mode'', ''On'') }}'
    turn_on:
      - data:
          action_code: 4
          device_number: 2
          value: 1
        action: rest_command.poolaction
      - delay: 0:00:02
      - entity_id:
        - sensor.pool_status
        action: homeassistant.update_entity
    turn_off:
      - data:
          action_code: 4
          device_number: 2
          value: 0
        action: rest_command.poolaction
      - delay: 0:00:02
      - entity_id:
        - sensor.pool_status
        action: homeassistant.update_entity

Sure, here’s one of my more complicated ones. If my solar system is generating more than 6kWh then it checks a helper to see if it should run. If the helper is ‘on’ (I toggle that on/off via the Lovelace gui) and the heat pump isn’t already on then it proceeds to turn the pool filter pump and electric heater on by activating the favourite. It then sends me a message via signal and to my watch letting me know it’s done that, as well as what the water temp currently is.

We get virtually nothing for power fed back into the grid now, so rather use that spare power to keep the water warm. :slight_smile:

alias: Pool - turn on heat pump if solar > 6kW
description: ""
triggers:
  - entity_id:
      - sensor.symo_15_0_3_m_1_ac_power
    for:
      hours: 0
      minutes: 20
      seconds: 0
    above: 6000
    trigger: numeric_state
conditions:
  - condition: and
    conditions:
      - condition: state
        entity_id: input_boolean.automation_pool_solar_heater
        state: "on"
      - condition: state
        entity_id: sensor.pool_heat_pump_mode
        state:
          - "Off"
actions:
  - action: notify.signal
    metadata: {}
    data:
      message: >-
        Pool - Solar greater than 6kW so turning on heatpump! 🌊🏊 The pool is
        currently: {{states('sensor.pool_current_temperature_2') }}
  - data:
      title: Pool - Solar greater than 6kW so turning on heatpump! 🌊🏊
      message: |
        Pool - Solar greater than 6kW so turning on heatpump! 🌊🏊
        The pool is currently: {{states('sensor.pool_current_temperature_2') }}
    action: persistent_notification.create
  - data:
      message: Pool - Solar greater than 6kW so turning on heatpump! 🌊🏊
      title: Pool - Solar greater than 6kW so turning on heatpump! 🌊🏊
    action: notify.mobile_app_google_pixel_watch
  - action: switch.turn_on
    metadata: {}
    data: {}
    target:
      entity_id:
        - switch.pool_favourite_filter_and_heatpump
  - action: climate.set_temperature
    metadata: {}
    data:
      temperature: 34
    target:
      entity_id: climate.pool_electric_heater_thermostat
mode: single

1 Like