999LV / SmartVirtualThermostat

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

SVT crashes Domoticz if it reads NaN temperature value #57

Closed maxcrystal closed 7 months ago

maxcrystal commented 2 years ago

SVT crashes Domoticz if it reads NaN temperature value. It occures sometimes with one of my temeperature sensors. I propose to add an error handler. Domoticz log:

2021-11-15 10:29:29.191  Error: BH: Main Room Thermostat: 'onHeartbeat' failed 'TypeError':'unsupported operand type(s) for +: 'int' and 'NoneType''.
2021-11-15 10:29:29.192  Error: BH: Main Room Thermostat: Exception traceback:
2021-11-15 10:29:29.192  Error: Domoticz(pid:1657, tid:1682('BH: Main Room T')) received fatal signal 11 (Segmentation fault)
2021-11-15 10:29:29.192  Error: siginfo address=0x679, address=0x76ba543f
2021-11-15 10:29:31.363  Pi: General/Custom Sensor (Arm Clock Speed)
2021-11-15 10:29:31.379  Pi: General/Custom Sensor (V3D Clock Speed)
2021-11-15 10:29:31.395  Pi: General/Custom Sensor (Core Clock Speed)
2021-11-15 10:29:33.189  Error: Thread 18 (Thread 0x6cafe430 (LWP 1682)):
2021-11-15 10:29:33.189  Error: #0  __libc_do_syscall () at ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:46
2021-11-15 10:29:33.190  Error: #1  0x76ba5086 in __waitpid (options=0, stat_loc=0x6cafd060, pid=1699) at ../sysdeps/unix/sysv/linux/waitpid.c:30
2021-11-15 10:29:33.190  Error: #2  __waitpid (pid=1699, stat_loc=0x6cafd060, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:25
2021-11-15 10:29:33.190  Error: #3  0x0028f944 in dumpstack_gdb(bool) ()
2021-11-15 10:29:33.190  Error: #4  0x0028ff10 in signal_handler(int, siginfo_t*, void*) ()
2021-11-15 10:29:33.190  Error: #5  <signal handler called>
2021-11-15 10:29:33.190  Error: #6  __libc_do_syscall () at ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:47
2021-11-15 10:29:33.190  Error: #7  0x76ba543e in __libc_signal_restore_set (set=0x6cafd7b4) at ../sysdeps/unix/sysv/linux/internal-signals.h:84
2021-11-15 10:29:33.190  Error: #8  raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:48
2021-11-15 10:29:33.190  Error: #9  <signal handler called>
2021-11-15 10:29:33.190  Error: #10 0x75dc16bc in PyObject_Str () from /usr/lib/arm-linux-gnueabihf/libpython3.5m.so
2021-11-15 10:29:33.190  Error: #11 0x00675d98 in Plugins::PyBorrowedRef::operator std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >() const ()
2021-11-15 10:29:33.190  Error: #12 0x00667ef8 in Plugins::CPlugin::LogTraceback(_traceback*) ()
2021-11-15 10:29:33.191  Error: #13 0x0066950c in Plugins::CPlugin::LogPythonException(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
2021-11-15 10:29:33.191  Error: #14 0x00669a50 in Plugins::CPlugin::Callback(_object*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, _object*) ()
2021-11-15 10:29:33.191  Error: #15 0x00216950 in Plugins::CPluginMessageBase::Process(Plugins::CPlugin*) ()
2021-11-15 10:29:33.191  Error: #16 0x00675054 in Plugins::CPlugin::Do_Work() ()
2021-11-15 10:29:33.191  Error: #17 0x008f9ff4 in execute_native_thread_routine ()
2021-11-15 10:29:33.191  Error: #18 0x76b9cc40 in start_thread (arg=0x65918372) at pthread_create.c:486
2021-11-15 10:29:33.191  Error: #19 0x76a8784c in ?? () from /lib/arm-linux-gnueabihf/libc.so.6