Update current temperature for Z-Wave thermostats

No, the script only adds a temperature value from sensor to the thermostat current_temperature attribute. The thermostat works completely alone on the basis of its own temperature measurements and HA can’t interfere with it beyond the target temperature change.

Vote for this feature Combine Danfoss 014G0013 thermostat and other temperature sensor to show current temperature if you want this as a standard in HA.

Did you already found a solution to get the current temp. in homebridge? I have the same problem.

Sort of. I have a Telldus znet for my 433 devices. I moved my Danfoss there, used this https://forum.telldus.com/viewtopic.php?f=31&t=6587&sid=36ba247e7b019d9e12f3480f92df5b0a&start=15 and hass generic thermostat. Works perfect, but I believe @Bieniu idea is better still.

/Johan

If someone prefers a script for AppDaemon then you can use this.

It also changes the thermostat status “unknown” to “heat” or “idle” depending on the target temperature.
image

1 Like

That’s great! How can i use it? I get the following error; 2018-03-06 18:58:53.606731 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/update_thermostats.py - ignoring

I added the .py script in the config\appdaemon\apps folder and restarted appaemon?

Thank you!

You have to add to apps.yaml thermostats and sensors entities. The order of thermostats and sensors is important. The first thermostat takes data from the first sensor, the second thermostat from the second sensor, etc.

update_thermostats:
  module: update_thermostats
  class: UpdateThermostats
  thermostats:
    - climate.thermostat_kuchnia
    - climate.thermostat_salon
    - climate.thermostat_antresola
    - climate.thermostat_sypialnia
    - climate.thermostat_lazienka
    - climate.thermostat_antek
  sensors:
    - sensor.temperature_kuchnia
    - sensor.temperature_salon
    - sensor.temperature_antresola
    - sensor.temperature_sypialnia
    - sensor.temperature_lazienka
    - sensor.temperature_antek

Thanks for your help Bieniu,

I’ve changed the apps.yaml with the correct name of the LC-13 and one of my temp sensors, but get the following error;

2018-03-07 08:12:41.236338 WARNING AppDaemon: ------------------------------------------------------------
2018-03-07 08:12:41.237605 WARNING AppDaemon: Unexpected error running initialize() for update_thermostats
2018-03-07 08:12:41.238701 WARNING AppDaemon: ------------------------------------------------------------
2018-03-07 08:12:41.242663 WARNING AppDaemon: Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/appdaemon/appdaemon.py", line 1495, in init_object
init()
  File "/config/appdaemon/apps/update_thermostats.py", line 12, in initialize
if self.check_entity(self.args['thermostats'][i]) == False:
  File "/config/appdaemon/apps/update_thermostats.py", line 63, in check_entity
while not (self.entity_exists(entity) or n > 120):
AttributeError: 'UpdateThermostats' object has no attribute 'entity_exists'
2018-03-07 08:12:41.243686 WARNING AppDaemon: ------------------------------------------------------------

update_thermostats:
  module: update_thermostats
  class: UpdateThermostats
  thermostats:
    - climate.danfoss_z_thermostat_014g0013_heating_1
  sensors:
    - sensor.fibaro_system_fgsd002_smoke_sensor_temperature

Very strange. Which version of AppDaemon do you use?

I’m using version 3.0, should i try 2.0?

Honestly, I don’t know what changes were introduced in 3.0. I use 2.1.12. If you can try version 2.x.

I use it with 3.0 and it works great. I made a few changes to fit my needs but the changes are only minor. As the lines in your errors don’t seem to match the most recent version on github, could you pastebin your version to get a better insight?

@Bieniu great work by the way. I just “upgraded” to your most recent version from github and implemented my changes.

1 Like

@cgtobi I’m curious what changes you made?

@Bieniu sure, no problem. I only made it work with 3.0 and slightly modified the behaviour when the thermostat displays idle or heat.

1c1
< import appdaemon.appapi as appapi
---
> import appdaemon.plugins.hass.hassapi as hass
27c27
< class UpdateThermostats(appapi.AppDaemon):
---
> class UpdateThermostats(hass.Hass):
53c53
<                 self.find_thermostat_state(float(target_temp))
---
>                 self.find_thermostat_state(float(target_temp), float(sensor_temp))
68c68
<                 self.find_thermostat_state(float(target_temp))
---
>                 self.find_thermostat_state(float(target_temp), float(current_temp))
73,74c73,74
<     def find_thermostat_state(self, temperature):
<         if temperature > 8:
---
>     def find_thermostat_state(self, target_temp, current_temp):
>         if round(current_temp) < round(target_temp):
87a88
> 
1 Like

Just to double check: are you talking about this ‘unknown’ state?

grafik

Exactly. Just like this:

grafik

Shouldn’t this be integrated for all climate devices in Home Assistant by default without the need for using external things (like app daemon)? Just being curious …

The Danfoss thermostats don’t return the actual temperature so HA can’t determine whether it is idle or heating. That’s why you have to manipulate it externally in combination with a temperature sensor. I seriously doubt that this hack would be accepted as a change for the generic thermostat.

Oh, missed that part. You’re right then.