999LV / SmartVirtualThermostat

Smart Virtual Thermostat python plugin for Domoticz home automation system
MIT License
41 stars 31 forks source link

Unexpected thermostat switch off #19

Closed Kptn77 closed 5 years ago

Kptn77 commented 5 years ago

Hi, I'm using your wonderfull work on my RPi with Domoticz, but I'm encountering an issue with temperature sensor reading (from a Xiaomi Gateway). Sometimes, the Gateway doesn't give Domoticz informations for a long time. So when the SVT ask it for calculation, it says: "No Inside Temperature found... Switching Thermostat Off" But I can see the last temperature in Domoticz. The result is that the thermostat is switched to Off and then my heater is not driven anymore. I have to manually switch On the thermostat control if I want SVT to drive the heater again.

I understand that SVT can't decide what to do if the temperature information is too old. But wouldn't it be possible to switch the heater Off rather than the thermostat control? In that way, the thermostat is going on the calculations and when the temperature information comes back, it can drive the heater again?

Thanks, Laurent.

999LV commented 5 years ago

This is actually a great idea and not difficult to implement. But not much free time at the moment to look into it, so unless you volunteer to edit the plugin and submit a pull request, you’ll have to bear with me for a few days at least. Merci.

Kptn77 commented 5 years ago

Hello, I, too, haven't much free time ^^ And I understand you have other priorities! I'll try, but I'm not a good developper ahaha. Thanks a lot for your reply.

Laurent.

999LV commented 5 years ago

@Kptn77 ,

I found the time to implement what you suggest: when no valid inside temp reading, instead of the thermostat being switched off, the heating will be switched off (and the thermostat switch as well as the thermostat temperature device will be marked as timedout - ie. appear in red background in domoticz GUI).

I however cannot test it for the moment. Can you please download the new version 0.4.8 from the development branch and report back ?

Kptn77 commented 5 years ago

Hello @999LV , I'm really sorry for the delay... I tried the modification but there's a bug in it: At line 539, you missed a "d" in "TimeOut".

I found this bug because the logs told 2019-03-10 11:19:20.431 Error: (SVT Chambre) 'CDevice_update' failed 'TypeError':''TimeOut' is an invalid keyword argument for this function'.

I modified the code and then it's Ok. But i'm not familiar with git so I don't know how to push...

I'm waiting for my temperature sensors not to be available to see if the modification acts as we like to ;-)

999LV commented 5 years ago

@Kptn77 ,

thanks for spotting the typo. I pushed a fix to the development branch. Please advise when properly tested, so that I merge this change into the main branch

Kptn77 commented 5 years ago

@999LV , Everything is Ok!! Thanks a lots :)

Now thermostat control stays in "Auto" mode and is red when the sensor hasn't been found (like the sensor). When the sensor is available again everything starts again.