Danfoss climate unknown info

@Bieniu , trying to put this in place for a Horstmann Thermostat (horstmann_hrt4zw_thermostat)

Reports current temperature fine but not state (heat. off).

Have the python file in place.

Automation for state based on posts above

###############################################
## Thermostat Automation ######################
###############################################
- id: heating_update_thermostats
  alias: 'Heating Update Thermostats'
  trigger:
platform: state
entity_id:
  - climate.horstmann_hrt4zw_thermostat_transmitter_heating_1_3
  action:
- service: python_script.heating_thermostat_update
  data:
    thermostat: trigger.entity_id
    sensor: sensor.horstmann_hrt4zw_thermostat_transmitter_temperature_2

- id: heating_update_thermostats_state_at_start
  alias: 'Heating Update Thermostats State At Start'
  trigger:
platform: event
event_type: zwave.network_ready
  action:
- service: python_script.heating_thermostat_update
  data:
    thermostat: climate.horstmann_hrt4zw_thermostat_transmitter_heating_1_3
    sensor: sensor.horstmann_hrt4zw_thermostat_transmitter_temperature_2

Added the horstmann thermostat temperature sensor to the automation above as required by pyhton file (eventually read the top of that file!)
Worked in 0.81.6

Updated to 0.82 and my log is showing the following

2018-11-10 20:12:56 ERROR (SyncWorker_3) [homeassistant.components.python_script.heating_thermostat_update.py] Error executing script: ‘NoneType’ object is not callable
Traceback (most recent call last):
File “/usr/src/app/homeassistant/components/python_script.py”, line 166, in execute
exec(compiled.code, restricted_globals, local)
File “heating_thermostat_update.py”, line 51, in
TypeError: ‘NoneType’ object is not callable
2018-11-10 20:12:56 ERROR (SyncWorker_9) [homeassistant.components.python_script.heating_thermostat_update.py] Error executing script: ‘NoneType’ object is not callable
Traceback (most recent call last):
File “/usr/src/app/homeassistant/components/python_script.py”, line 166, in execute
exec(compiled.code, restricted_globals, local)
File “heating_thermostat_update.py”, line 51, in
TypeError: ‘NoneType’ object is not callable

@fergalom If your thermostat has a temperature sensor, you don’t need to pass the temperature to it. You have to use this version of the scipt to change state of the termostat.

Thanks @Bieniu, replaced the python with your linked code and also removed the sensor from the automation but still getting the same error in the log.

2018-11-14 11:18:03 ERROR (SyncWorker_3) [homeassistant.components.python_script.heating_thermostat_update.py] Error executing script: ‘NoneType’ object is not callable
Traceback (most recent call last):
File “/usr/src/app/homeassistant/components/python_script.py”, line 166, in execute
exec(compiled.code, restricted_globals, local)
File “heating_thermostat_update.py”, line 72, in
TypeError: ‘NoneType’ object is not callable
2018-11-14 11:20:01 ERROR (SyncWorker_10) [homeassistant.components.python_script.heating_thermostat_update.py] Error executing script: ‘NoneType’ object is not callable
Traceback (most recent call last):
File “/usr/src/app/homeassistant/components/python_script.py”, line 166, in execute
exec(compiled.code, restricted_globals, local)
File “heating_thermostat_update.py”, line 72, in
TypeError: ‘NoneType’ object is not callable

It has the following attributes reported:

entity_id: "climate.horstmann_hrt4zw_thermostat_transmitter_heating_1_3"

    state: "off"

    attributes: object

    current_temperature: 18.3

    min_temp: 7

    max_temp: 35

    temperature: 11

    operation_mode: "off"

    operation_list: array[2]

    0: "off"

    1: "heat"

    node_id: 8

    value_index: 1

    value_instance: 1

    value_id: "72057594177437714"

    friendly_name: "Horstmann HRT4-ZW Thermostat Transmitter Heating 1"

    supported_features: 129

This is after using script? Thermostat has state. My script has 18 lines but error in your log is in line 51. Do you correctly installed script file? Please remove script from automation, restart HA and show me thermostat’s entity after that.

@Bieniu Yes.
Thermostat has always had a state but always off (state never changed to heat)

WIth your script, it worked for me and changed state to heat for 0.8.1.6 but not 0.82 HA

Yes, your script has 18 lines, I had simply commented out the old script, and pasted in your new code, saved and restarted HA.

With your automation removed, restart HA, entity id is the same.

		entity_id: "climate.horstmann_hrt4zw_thermostat_transmitter_heating_1_3"
		state: "off"
		attributes: object
			current_temperature: 18.2
			min_temp: 7
			max_temp: 35
			temperature: 11
			operation_mode: "off"
			operation_list: array[2]
				0: "heat"
				1: "off"
			node_id: 8
			value_index: 1
			value_instance: 1
			value_id: "72057594177437714"
			friendly_name: "Horstmann HRT4-ZW Thermostat Transmitter Heating 1"
			supported_features: 129

With python script (18 lines) / automation added back in

2018-11-14 12:39:40 ERROR (SyncWorker_14) [homeassistant.components.python_script.heating_thermostat_update.py] Error executing script: 'NoneType' object is not callable
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/components/python_script.py", line 166, in execute
exec(compiled.code, restricted_globals, local)
  File "heating_thermostat_update.py", line 8, in <module>
TypeError: 'NoneType' object is not callable

This is very strange. In my system with HA 0.82 script is working without any errors. Which version of python do you use?

I use the standard HA docker container.
From the build file, it says python 3.6
https://hub.docker.com/r/homeassistant/home-assistant/~/dockerfile/

I also use python 3.6. Unfortunately, I can’t reproduce this error in my configuration.

Thanks, thats ok. I’ll try a fresh docker with just thermostat in case I have done something stupid along the way with configs etc.

Bieniu made a great job, as for others my thermostats and sensors do not share names so I modified script to support that.
I use it like that:

- id: heating_update_thermostats
  alias: 'Heating Update Thermostats'
  trigger:
    platform: state
    entity_id:
      - sensor.motion_biuro_temperature
      - sensor.motion_chlopcy_temperature
      - sensor.motion_sypialnia_temperature
      - sensor.motion_salon_tv_temperature
      - sensor.motion_kuchnia_temperature
      - climate.heater_biuro_f
      - climate.heater_dzieci_d
      - climate.heater_sypialnia_d
      - climate.heater_salon_d
      - climate.heater_jadalnia_d
  condition:
    condition: template
    value_template: >-
      {% if 'heater' in trigger.entity_id and trigger.to_state.attributes.current_temperature == none %}
        true
      {% elif 'sensor' in trigger.entity_id %}
        true
      {% else %}
        false
      {% endif %}
  action:
    service: python_script.heating_thermostat_update
    data_template:
      sensors:
        - sensor.motion_biuro_temperature
        - sensor.motion_chlopcy_temperature
        - sensor.motion_sypialnia_temperature
        - sensor.motion_salon_tv_temperature
        - sensor.motion_kuchnia_temperature
      thermostats:
        - climate.heater_biuro_f
        - climate.heater_dzieci_d
        - climate.heater_sypialnia_d
        - climate.heater_salon_d
        - climate.heater_jadalnia_d
      entity_id: '{{trigger.entity_id}}'

You can find script here:

1 Like