Was Working…but now getting some warnings and errors and not working again ugh…
Logger: homeassistant.helpers.template
Source: helpers/template.py:1822
First occurred: 3:29:50 AM (2 occurrences)
Last logged: 3:29:50 AM
Template variable warning: 'mappingproxy object' has no attribute 'temperature' when rendering '{{ states.sensor.pool_status.attributes["temperature"] }}'
Template variable warning: 'mappingproxy object' has no attribute 'active_favourite' when rendering '{{ states.sensor.pool_status.attributes["active_favourite"] }}'
Logger: homeassistant.components.template.template_entity
Source: components/template/template_entity.py:167
Integration: Template (documentation, issues)
First occurred: 3:29:50 AM (8 occurrences)
Last logged: 3:29:50 AM
TemplateError('UndefinedError: 'mappingproxy object' has no attribute 'heaters'') while processing template 'Template("{{ states.sensor.pool_status.attributes["heaters"][0]["spa_set_temperature"]|int }}")' for attribute '_attr_native_value' in entity 'sensor.pool1_heaters0_spa_settemp'
TemplateError('UndefinedError: 'mappingproxy object' has no attribute 'lighting_zones'') while processing template 'Template("{{ ['Off', 'Auto', 'On'][states.sensor.pool_status.attributes["lighting_zones"][0]["mode"]|int] }}")' for attribute '_attr_native_value' in entity 'sensor.pool1_lighting_zones'
TemplateError('UndefinedError: 'mappingproxy object' has no attribute 'channels'') while processing template 'Template("{{ ['Off', 'Auto', 'On'][states.sensor.pool_status.attributes ["channels"][4]["mode"]|int] }}")' for attribute '_attr_native_value' in entity 'sensor.pool1_channels4_mode'
TemplateError('UndefinedError: 'mappingproxy object' has no attribute 'channels'') while processing template 'Template("{{ ['Off', 'Auto', 'On', 'Low Speed', 'Medium Speed', 'High Speed'][states.sensor.pool_status.attributes ["channels"][0]["mode"]|int] }}")' for attribute '_attr_native_value' in entity 'sensor.pool1_channels0_mode'
TemplateError('UndefinedError: 'mappingproxy object' has no attribute 'channels'') while processing template 'Template("{{ ['Off', "Auto", 'On'][states.sensor.pool_status.attributes ["channels"][5]["mode"]|int] }}")' for attribute '_attr_native_value' in entity 'sensor.pool1_channels5_mode'
Logger: homeassistant.components.homeassistant.triggers.numeric_state
Source: components/homeassistant/triggers/numeric_state.py:179
Integration: Home Assistant Core Integration (documentation, issues)
First occurred: 3:29:50 AM (2 occurrences)
Last logged: 3:29:50 AM
Error in 'Pool Hot - Pump Off' trigger: In 'numeric_state' condition: entity sensor.pool1_temperature state '' cannot be processed as a number
Error in 'Pump On - Pool Cold' trigger: In 'numeric_state' condition: entity sensor.pool1_temperature state '' cannot be processed as a number
here is one of the automations (works fine if manual update in developer tools, but isn’t triggering on its own…but the temp gauge on dashboard is working
- id: '1644106618859'
alias: Pump On - Pool Cold
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.pool1_temperature
below: '31'
condition:
- condition: time
after: 08:10:00
before: '20:30:00'
- condition: state
entity_id: switch.pool_channel4
state: 'off'
- condition: numeric_state
entity_id: sensor.durst_home_general_price
below: '0.15'
action:
- service: notify.notify
data:
message: Pump On - Pool Cold
title: Pump On - Pool Cold
- service: rest_command.poolaction
data:
action_code: 1
device_number: 5
- delay:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
- service: homeassistant.update_entity
entity_id: sensor.pool_status
mode: single
and Here is my entire config file (which is only for this at this point)…switches work and update status correctly, temp sensor on dashboard shows correct current temp…not sure.
although think it is time I split my config file
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Text to speech
tts:
- platform: google_translate
##
##
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
##
sensor:
#
- platform: rest
name: Pool Status
resource: https://www.connectmypool.com.au/api/poolstatus
method: POST
# Change the API to match yours. You might want to put this in your secrets file.
payload: '{ "pool_api_code": "xxxxxx-xxxxxxx" }'
force_update: true
json_attributes:
- pool_spa_selection
- heat_cool_selection
- temperature
- active_favourite
- heaters
- solar_systems
- channels
- valves
- lighting_zones
value_template: 'OK'
scan_interval: 35
verify_ssl: false
headers:
User-Agent: Home Assistant
Content-Type: application/json
###
- platform: template
sensors:
pool1_pool_spa_selection:
friendly_name: Pool - Pool Spa Selection
value_template: >-
{{ ['Spa', 'Pool'][states.sensor.pool_status.attributes["pool_spa_selection"]|int] }}
pool1_temperature:
friendly_name: Pool - Current Temperature
value_template: '{{ states.sensor.pool_status.attributes["temperature"] }}'
device_class: temperature
unit_of_measurement: '°C'
pool1_active_favourite:
friendly_name: Pool - Active Favourite
value_template: '{{ states.sensor.pool_status.attributes["active_favourite"] }}'
pool1_heaters0_mode:
friendly_name: Pool - Heater Mode
value_template: >-
{{ ['Off', 'On'][states.sensor.pool_status.attributes["heaters"][0]["mode"]|int] }}
pool1_heaters0_settemp:
friendly_name: Pool - Heater set temperature
value_template: >-
{{ states.sensor.pool_status.attributes["heaters"][0]["set_temperature"]|int }}
device_class: temperature
unit_of_measurement: '°C'
pool1_heaters0_spa_settemp:
friendly_name: Spa - Heater set temperature
value_template: >-
{{ states.sensor.pool_status.attributes["heaters"][0]["spa_set_temperature"]|int }}
device_class: temperature
unit_of_measurement: '°C'
pool1_lighting_zones:
friendly_name: Lighting Mode
value_template: >-
{{ ['Off', 'Auto', 'On'][states.sensor.pool_status.attributes["lighting_zones"][0]["mode"]|int] }}
pool1_channels4_mode:
friendly_name: HeatPump Pump
value_template: >-
{{ ['Off', 'Auto', 'On'][states.sensor.pool_status.attributes ["channels"][4]["mode"]|int] }}
pool1_channels0_mode:
friendly_name: Pool Circulation Pump
value_template: >-
{{ ['Off', 'Auto', 'On', 'Low Speed', 'Medium Speed', 'High Speed'][states.sensor.pool_status.attributes ["channels"][0]["mode"]|int] }}
pool1_channels5_mode:
friendly_name: Spa Jets Mode
value_template: >-
{{ ['Off', "Auto", 'On'][states.sensor.pool_status.attributes ["channels"][5]["mode"]|int] }}
#
rest_command:
poolaction:
url: "https://www.connectmypool.com.au/api/poolaction"
method: post
content_type: 'application/json; charset=utf-8'
payload: '{"pool_api_code": "xxxxxx-xxxxxx","action_code": {{action_code}},"device_number": {{device_number}},"value": "{{value}}","wait_for_execution": false}'
verify_ssl: true
cyclechannel:
url: "https://www.connectmypool.com.au/api/poolaction"
method: post
content_type: "application/json; charset=utf-8"
payload: '{"pool_api_code": "xxxxxx-xxxxxx","action_code": 1, "device_number": {{ channel }}, "value": "", "wait_for_execution": false}'
verify_ssl: true
##
switch:
#########################################
####### ASTRAL POOL LIGHT SWTICH ########
#########################################
- platform: template
switches:
pool_lights:
value_template: "{{ is_state('sensor.pool1_lighting_zones', 'On') }}"
friendly_name: Pool Light Switch
turn_on:
- service: rest_command.poolaction
data:
action_code: 6
device_number: 0
value: 2
- delay: 2
- service: homeassistant.update_entity
entity_id: sensor.pool_status
turn_off:
- service: rest_command.poolaction
data:
action_code: 6
device_number: 0
value: 1
- delay: 2
- service: homeassistant.update_entity
entity_id: sensor.pool_status
#
- platform: template
switches:
pool_spa_selection:
value_template: "{{ is_state('sensor.pool_spa_selection', 'Pool') }}"
friendly_name: Pool Spa Mode Switch
turn_on:
- service: rest_command.poolaction
data:
action_code: 3
device_number: 0
value: 1
- delay: 2
- service: homeassistant.update_entity
entity_id: sensor.pool_status
turn_off:
- service: rest_command.poolaction
data:
action_code: 3
device_number: 0
value: 0
- delay: 2
- service: homeassistant.update_entity
entity_id: sensor.pool_status
#
- platform: template
switches:
pool_heater:
value_template: "{{ is_state('sensor.pool1_heaters0_mode', 'On') }}"
friendly_name: "Pool Heater Switch - {{ states('sensor.pool1_heaters0_mode') }}"
turn_on:
- service: rest_command.poolaction
data:
action_code: 4
device_number: 1
value: 1
- delay: 2
- service: homeassistant.update_entity
entity_id: sensor.pool_status
turn_off:
- service: rest_command.poolaction
data:
action_code: 4
device_number: 1
value: 0
- delay: 2
- service: homeassistant.update_entity
entity_id: sensor.pool_status
#########################################
####### ASTRAL POOL CHANNEL4 TOGGLE #####
#########################################
- platform: template
switches:
pool_channel4:
value_template: "{{ is_state('sensor.pool1_channels4_mode', 'On') }}"
friendly_name: "Heater Pump - {{ states('sensor.pool1_channels4_mode') }}"
turn_on:
- service: rest_command.poolaction
data:
action_code: 1
device_number: 5
- delay: 2
- service: homeassistant.update_entity
entity_id: sensor.pool_status
turn_off:
- service: rest_command.poolaction
data:
action_code: 1
device_number: 5
- delay: 2
- service: homeassistant.update_entity
entity_id: sensor.pool_status
#########################################
####### ASTRAL POOL CHANNEL5 TOGGLE #####
#########################################
- platform: template
switches:
pool_channel5:
value_template: "{{ is_state('sensor.pool1_channels5_mode', 'On') }}"
friendly_name: "Spa Jets - {{ states('sensor.pool1_channels5_mode') }}"
turn_on:
- service: rest_command.poolaction
data:
action_code: 1
device_number: 6
- delay: 2
- service: homeassistant.update_entity
entity_id: sensor.pool_status
turn_off:
- service: rest_command.poolaction
data:
action_code: 1
device_number: 6
- delay: 2
- service: homeassistant.update_entity
entity_id: sensor.pool_status
#########################################
####### ASTRAL POOL CHANNEL0 TOGGLE #####
#########################################
- platform: template
switches:
pool_channel0:
value_template: "{{ is_state('sensor.pool1_channels0_mode', 'Auto') }}"
friendly_name: "Circulation Pump - {{ states('sensor.pool1_channels0_mode') }}"
turn_on:
- service: rest_command.poolaction
data:
action_code: 1
device_number: 0
- delay: 2
- service: homeassistant.update_entity
entity_id: sensor.pool_status
turn_off:
- service: rest_command.poolaction
data:
action_code: 1
device_number: 0
- delay: 2
- service: homeassistant.update_entity
entity_id: sensor.pool_status
#########################################
####### ASTRAL POOL CHANNEL1 TOGGLE #####
#########################################
##
Started on this Journey almost solely to get some better control of the pool heating…/.by turning off the pump rather then Heater (Heatpump) when either temp was reached or electricity through amber was expensive…beofe 5 days ago, I had zero HA experience…and haven’t ever done programming beyond a high school class or two… 30 Years ago