I have upgraded a Max! heating system in two different locations and since the locations had acquired a few other IoT-devices, then I decided to try and make a central IoT control point based on Home Assistant, but I have run into an issue with some of the IoT items.
In one of the locations its 2 different models of Air-toAir heat pumps.
They have a few state values that can be set, but would otherwise be null if not set, like max and min heat settings on the thermostat.
If I pull those values from HA and the min and max values are not set, IE. they are null, then I get 30 degress celsius as max and 5 as min from one of the devices and some other values from the other, since they are not same model.
If I set the values then I get the values I have set, but I can not set these values back to null again from HA and have the devices report their factory values.
Funny enough I can easily change the values in HA and even set min and max to 0 and 100 and get those reported back, even though I can set the target temperature to anyway.
Whenever I have set the values in HA, then I have to startup the program that came with the devices and reset the values to get back to factory setting.
In the other location I have central heating and I invested Homematic IP devices, but I have a similar problem.
The thermostats have a Boost mode, then move the thermostat valve to open for a set amount of time when triggered and then return to the previous setting afterwards.
When I look in the developer tool I see these state attributes:
hvac_modes: auto, heat, off
min_temp: 4.5
max_temp: 30.5
target_temp_step: 0.5
preset_modes: boost
current_temperature: 21.7
temperature: 20
preset_mode: null
id: 00201A49A56339
interface: ip
battery: High
rssi_device: -59
valve: 4
level: 0
mode: null
voltage: 3
friendly_name: Office Thermostat
supported_features: 17
I have made a template on the device to report the preset mode with this:
sensor thermostat_sensor:
- platform: template
sensors:
thermostat_boost:
friendly_name: "Thermostat Boost"
unique_id: "thermostatboost"
value_template: >-
{% if (state_attr('climate.thermostat', 'preset_mode') == 'boost') %}
On
{% elif (state_attr('climate.thermostat', 'preset_mode') == None) %}
Off
{% else %}
Unknown
{% endif %}
Whenever I physically activate and deactivate the Boost I get changes on the sensor and it reports On or Off and never Unknown, so it must be able to read the null value.
I have then made a simple script to toogle the Boost on and off.
service: climate.set_preset_mode
entity_id: climate.officethermostat
data:
preset_mode: |
{% if (states('sensor.office_thermostat_boost')=='Off') %}
boost
{% else %}
None
{% endif %}
I can with the script turn the Boost mode on, but I can not turn it off again by setting the value to null.
I had hoped I could make another preset mode on the devices that just lasted 1 second and switch to them instead, but I have not had any luck in doing so yet.
So how do I set a state attribute to null?