Just bought a pellets stove and have done some coding with dzVents, but can use a little help in optimizing the code to shutdown from every possible state the stove is in.
Stove has the following characteristics.
- The infrared remote has 2 buttons. One to step through the ventilation levels and one through the warming levels. I have recorded these commands and can send them through shell scripts with push on buttons. It works great.
- You can't press both buttons simultaneously.
- There has to be some delay (let's take 1 second) between every button press, to ensure that the infrared commands are send correctly.
- You can only step through both levels incrementally. So you can't switch from 1 to i.e. level 5 in one press.
- It has 6 (1 t/m 6, no off state) levels of ventilation which work independent of the level of warming
- It has 5 levels of warming which work independent of the ventilation level.
- It goes into shutdown mode (off state) when you press one more time on the warming button after level 5 and wait for more than 5 seconds. If you press again within 5 seconds it goes back to level 1. Let's call this warming level 0 (=Off).
- You can turn the stove on from the off state to any level of warming. But have to do this incrementally of course.
I track the state of both levels with global variables. I don't touch the buttons on the stove. I use a custom button and control the stove through domoticz. I have defined 1 on/off switch and 2 push on buttons (1 for stepping through ventilation level and one through warming). I have a selector switch from which I can put the stove in several combinations of ventilation and warming with one click. It all works pretty good.
Now the question

Hope I didn't forget something, feel free to ask and thanks for any help!