-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thermostat Controller #8212
Thermostat Controller #8212
Conversation
…as a Domoticz (running on a raspberry pi) script and controlling Qubino relays for floor heating. Ported to tasmota to get the logic within the relay itself and be less dependent on Domoticz. The controller supports several working modes. From off (no action) to manual (following input), automatic (hybrid, rampup or pi controller) and timeplan (automatic following predefined schedule with 3 temperatures for each weekday). It is fully configured via commands, it will include in the future diagnostics and will be extended to more outputs (will be tested on sonoff 4CH Pro). The controller has been tested successfully with a Shelly 1PM device and works as the original LUA domoticz script.
- Add config version tag - Bump version 8.2.0.4
This reverts commit 431ad42.
This reverts commit 56788a3.
Fix error for ESP32. Scripts checks if exists and generates only in target folder if there
to build special Tasmota versions with Compiler switches defined in [env:tasmota-xyz] in `platformio_tasmota_cenv.ini` to control user_config_override.h Example: "[env:tasmota-zigbee] build_flags = ${common.build_flags} -DHANS_CONFIG_ZIGBEE=true" which referrs to in user_config_override.h ```#ifdef HANS_CONFIG_ZIGBEE // ****************************************************************** #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "ZIGBEE" #define USE_WEBSERVER // Enable web server and Wifi Manager (+66k code, +8k mem) #define USE_JAVASCRIPT_ES6 // Enable ECMAScript6 syntax using less JavaScript code bytes (fails on IE11) // #define USE_WEBSEND_RESPONSE // Enable command WebSend response message (+1k code) //#define USE_RULES // Add support for rules (+4k4 code) // #define USE_EXPRESSION // Add support for expression evaluation in rules (+3k2 code, +64 bytes mem) // #define SUPPORT_IF_STATEMENT // Add support for IF statement in rules (+4k2 code, -332 bytes mem) // #define SUPPORT_MQTT_EVENT // Support trigger event with MQTT subscriptions (+3k5 code) //#define USE_SCRIPT // Add support for script // #define USE_SCRIPT_FATFS 4 // Add support for script storage on SD card (+12k code, +4k mem) // #define USE_SCRIPT_WEB_DISPLAY #define USE_ADC_VCC // Display Vcc in Power status. Disable for use as Analog input on selected devices // -- Zigbee interface ---------------------------- #define USE_ZIGBEE // Enable serial communication with Zigbee CC2530 flashed with ZNP (+35k code, +3.2k mem) #define USE_ZIGBEE_PANID 0x1A63 // arbitrary PAN ID for Zigbee network, must be unique in the home #define USE_ZIGBEE_EXTPANID 0xCCCCCCCCCCCCCCCCL // arbitrary extended PAN ID #define USE_ZIGBEE_CHANNEL 11 // Zigbee Channel (11-26) #define USE_ZIGBEE_PRECFGKEY_L 0x0F0D0B0907050301L // note: changing requires to re-pair all devices #define USE_ZIGBEE_PRECFGKEY_H 0x0D0C0A0806040200L // note: changing requires to re-pair all devices #define USE_ZIGBEE_PERMIT_JOIN false // don't allow joining by default #define USE_ZIGBEE_COALESCE_ATTR_TIMER 350 // timer to coalesce attribute values (in ms) #endif ```
Add ESP32 brownout disable for weak onboard LDO's - eventually you'll need to change the LDO to a better one.
… as a LUA script running in Domoticz on a Raspberry Pi to control floor heating valves using Qubino relays. I have ported this to a Tasmota driver embedding the functionality in the relays. This driver has been successfully tested with a shelly 1PM. The controller offers 3 controlling strategies (Hybrid, Rampup and PI) as well as time planning (3 diff. temp. each weekday).
issue, address not correct: do you think, you can integrate like tasmota timers? i don't now if this works, but will be easier for set heating plan. |
From what I can see you are not using Flash Settings anymore, but only compile time options. Right? |
Thanks for the comments:
|
There is no need to scan JSON messages to find a locally connected temperature sensor. Tasmota provides an internal variable called So I suggest you rewrite your latest addition using the knowledge from I suggest too to search for And pls remember, keep the code as small as possible. I see a lot of logging which luckily can be disabled by a define which looks good. |
Thanks for the tip, I have modified the code to use global_temperature but I have issues. In the shelly PM I have attached a DS18B20 and adapted the template according to your modifications (old issue from February I think) to read both temperatures the internal one of the module and the DS18B20. The issue is that the variable global_temperature is being update with both of them sequentially: Example of my reads: I can have a look to solve the issue, but currently I foresee that all modules with an internal temperature sensor and an attached external one would face this problem. Maybe it would make sense to separate the global_temperature into two variables, one for internal and one for external, since you need to keep the overtemperature protection feature of the modules in xdrv_03_energy.ino. Regarding Debug, yes, I will leave everything into the define and disable it by default, furthermore it is my intention to reduce it drastically soon, since I see that the controller reacts exactly as the one I have in Domoticz based on LUA. |
You're right. I had hoped only one sensor was connected but if more are used it becomes "messy". Adding and "external" global_temperature is indeed a fix as long as there is only one external sensor connected. It will need a kind of large rework task. For now, let's leave your solution in place and only think about a possible global solution. |
…optimizations pending
Would it be hard to implement control by humidity rather than temperature? |
It means some rework but it is feasible. I can make it active via define to save some memory and will need to think about a better name for the driver. If you describe the system a little bit I can add it to the lists of TODO´s and evaluate |
hi @arijav, awesome PR! Do you think it makes sense to add telemetry output enabling tasmota Rules tapping into the output value and do other things rather than MQTT and Relay control? |
Thanks, what it is foreseen is to be able to configure the timers to arm the thermostat to reach a given set point and disarm them and therefore rules could be used. Do you mean this or something else (maybe an example can help)? |
First of all, I am really excited about this capability. I don't like the idea of thermostats running off external devices, so having it integrated on the controller is perfect. Thank you. Some general feedback:
For example, compressor based heat pumps (AC/cooling/heating) need a minimum cycle time because you don't want to restart a compressor quickly; this can lead to stalling. Inversely, a sousvide cooker would want a fast cycle time. I feel this is pretty important. There are also TECs that may need proportional control (not just on or off but on percentages) using PIDs. Its unlikely many will use this. Some really complicated systems use variable speed heat pumps. You see these marketed as "inverters". It would be great if this code could also manage error states. For example, if the heater is "ON" but it's not getting warmer, it's an error. Same for AC on but not cooling. In some cases it should error on overrun: if it's set to cool down to 1c, but we are below that (say -3c) that could be worthy of an error flag. If this was used to control a fridge you don't want to go below freezing. A related, but harder to compute is a flag for "stable temp". Eg: it's not oscillating, overrun, underrun, etc.
Anyway, none of this needs to be implemented, this is not a feature request, but just some food for thought. |
My point is pretty much the same as @3ricj
I can see 2 types of the telemetry output:
For example, to control the duty cycle of some inverter one can use:
For example, to control the boiler with PID:
In those examples telemetry JSON might look like:
|
Understood, will evaluate for sure. Thanks for the input |
Hi ! I'm using Thermostat feature since a fex days now. I wonder if there is any option to activate telemetry with cycle reset, max time, ... any reasons that trigger Power ON/OFF ? Thanks. |
Description:
New driver created for thermostat control. I have created initially this as a LUA script running in Domoticz on a Raspberry Pi to control floor heating valves using Qubino Z-wave relays. I have ported this to a Tasmota driver embedding the functionality in the relays. This driver has been successfully tested with a Shelly 1PM, a Shelly 2.5 and a Sonoff 4CH PRO R2. Summary of the features:
Future features (TODO´s):
Related issue (if applicable): fixes #
Checklist: