Skip to content
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

The Hard Thermostat merge #3375

Closed
mcc05 opened this issue Jul 30, 2018 · 9 comments
Closed

The Hard Thermostat merge #3375

mcc05 opened this issue Jul 30, 2018 · 9 comments

Comments

@mcc05
Copy link

mcc05 commented Jul 30, 2018

Been testing out the Hard Thermostat #481, code and it seems to work great, however it predates timers which would make it excellent, and chance of a merge, or similar web driven functionality, that uses the rules functinallity introduced.

@ascillato
Copy link
Contributor

Hi,

Yes, would be great to have a webmenu for a chrono-thermostat but there is not much flash memory to add much more webmenus. By now, you can use the thermostat example that is in the wiki at the chapter rules.

The User Interfacing can be done in your home automation software. Your HA can send mqtt messages to give new temperature setpoints.

May be in the future we can find a better way.

@andrethomas
Copy link
Contributor

@mcc05 Using a HA really adds a lot more functionality - I have node-red running monitoring bedroom temperature using a BMP180 sensor connected to an ESP8266 Tasmota firmware board which sends temperature to node-red on 15 second intervals through telemetry logging. Node-red then decides what to do sending either on or off commands to a sonoff basic to turn the heater on and off.

I also have my electric blanket connected to a sonoff on full setting all day and it goes on for a few minutes when I shut down in my lab and warms up the bed whilst I am on my way past the kitchen... then switches to an interval based on the temperature in the room which usually results in something around 50 seconds out of every 5 minutes.

Further to this I can schedule in node-red and also change settings/parameters using messaging from my phone using Telegram (similar to Whatsapp, perhaps just less popular but it has a open API)

image

Looks like the temp in the room is still dropping at around 0.1 deg C/ 30minutes so it should kick in automagically when it reaches 19.0 degrees and then it will bounce between that and 19.2 throughout the night and eventually switch off sometime in the morning.

@mcc05
Copy link
Author

mcc05 commented Jul 31, 2018

I agree with you both. But would be nice to create rules without console just like timers. a thermostat is one very good use case for Sonoffs in general.

I agree with the HA approach for complex interactions, but I would prefer this for augmenting a bullet proof 'just do this' until told different without Wi-Fi etc.
I will try the rules based example on the wikki to see how it compares.

@tbagro
Copy link

tbagro commented Aug 10, 2018

how do i use a standalone command for dht sensor? is possible?
I am use DHT11, i try this command:

Rule1 1 on DHT11#temperature>28 do power1 1 endon on dht11#temperature<30 do power1 0 endon

@mcc05
Copy link
Author

mcc05 commented Aug 12, 2018

All,
So I've played with the thermostat example from the wiki, and firstly it doesn't work as expected, changing mem1 without the switch had no effect, so I have re-written it to:

rule1
on system#boot backlog do ruletimer1 30 endon
on Switch1#State do event toggling1=%mem1% endon
on event#toggling1=0 do mem 1 endon
on event#toggling1=1 do mem 0 endon
on rules#timer=1 do backlog var1 0; ruletimer1 30; power1 0; endon
on tele-AM2301#temperature do backlog var1 1; ruletimer1 30; event ctrl_ready=1; event temp_demand=%value%; endon
on event#ctrl_ready>%mem1% do var1 0 endon
on event#temp_demand>%mem2% do power1 0 endon
on event#temp_demand<%mem3% do power1 %var1% endon

The next problem is timers, so I have the following:
rule2
on Clock#Timer=1 do mem 1 endon on Clock#Timer=2 do mem 0 endon
on Clock#Timer=3 do mem 1 endon on Clock#Timer=4 do mem 0 endon
on Clock#Timer=5 do mem 1 endon on Clock#Timer=6 do mem 0 endon
on Clock#Timer=7 do mem 1 endon on Clock#Timer=8 do mem 0 endon
on Clock#Timer=9 do mem 1 endon on Clock#Timer=10 do mem 0 endon
on Clock#Timer=11 do mem 1 endon on Clock#Timer=12 do mem 0 endon
on Clock#Timer=13 do mem 1 endon on Clock#Timer=14 do mem 0 endon

which does equate to controlling 1 on and off time period per day of the week, however most thermostats at least allow for 3 schedules per day, morning / afternoon / nighttime, but with only 16 timers this is not possible it would need 21.

Is there a better way to do timers or a way to increase the numbers? It would be nice if each timer supported a start/stop time, then in effect for the 16 we would get 32 timeslices?

Mark

@mcc05
Copy link
Author

mcc05 commented Aug 13, 2018

I've updated the wiki with a working example, I've been running it for a day now with no issues.

@mcc05 mcc05 closed this as completed Aug 13, 2018
@tbagro
Copy link

tbagro commented Aug 14, 2018

thanks for the answer, I tried to use the commands on a wemos D1 mini (18 Generic mode), not unfortunately did not work.
But I tried on a sonoff, apparently it worked.

"Is there a better way to make timers or a way to increase numbers? Would it be nice if each timer supported a start / stop time, then in effect for the 16, we would get 32 timeslices?"_
for this question my answer I imagine the best solution would be to set a range within each timer.

Another idea that would find more interesting, is instead of "CONFIGURE_TIMER", there should be a "CONFIGURE_RULE" with the following options, timer-on / timer-off and interval, temp-on / temp-off for example.

@mcc05
Copy link
Author

mcc05 commented Aug 16, 2018

So the thermostat rules do not work on d1 mini?? works on sonoff basic and that's not a th which it said it was for

@tbagro
Copy link

tbagro commented Aug 16, 2018

I could not make wemos D1 work, just the timer function, I did not test the thermostat rules in sonoff, because mine is a basic sonoff.
But I confess that I still do not understand the rules for the thermostat when using a DHT11.

@ascillato ascillato mentioned this issue Apr 20, 2020
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants