HestiaPi / hestia-touch-openhab

OpenHAB2 files for HestiaPi Touch model
GNU General Public License v3.0
62 stars 17 forks source link

restoreOnStartup to preserve config Item states #27

Closed rkoshak closed 4 years ago

rkoshak commented 4 years ago

Changes include:

Everything seems to check out on my system. It's really nice not to lose the settings on a restart. It also is a nice way to see when the System started Rule starts to run as the display switches from the default showing "Off" to the version with the three icons at the top and my restored setpoint value. I wonder if one could/should use a command from OH in this System started rule to change from the "HestiaPi is starting" display to functional?

In the future, I'd like to understand why the UI requires commands to show the current settings correctly given that the MQTT messages are sent with the retained flag set. When the UI comes up it should pick up the most recent setting values from MQTT automatically when it connects to the broker. But that's for later.

Solves Issue #8.

Signed-off-by: Richard Koshak rlkoshak@gmail.com

rkoshak commented 4 years ago

Shoot! Somehow this undid a bunch of changes. I was sure I was up to date with ONE but I guess not. I need to fix the .rules files and the .items file. Hold off on the review until I fix that stuff.

gulliverrr commented 4 years ago

I'm off to bed. Won't touch anything until you say so and it doesn't have to be today, so no rush.

rkoshak commented 4 years ago

OK, the diffs now look right. There are no-unintentional changes, ready for review.

rkoshak commented 4 years ago

Now I lost one of my changes. StringType cannot be sent as a command so the lambdas at the top of the Rule need to use toString. This should be the last commit. To this PR until there is a review.

gulliverrr commented 4 years ago

@rkoshak For EU/Generic systems, humidity control and hot water have the following same issue:

rkoshak commented 4 years ago

I'll take a look at this later today. But given this branch has been merged we probably should open an issue and I'll submit a fix in a new PR.

rkoshak commented 4 years ago

Could you go to #31 and post the contents of openhab.log from when you change the Humidity mode? Also verify that HumidityType has a valid value. If not I may need to add something to the initialize rule to make sure that happens as it should. I'm not seeing the same behavior.