I’m not in a place where I can test it out but I’ll try to see what works when I get a chance. But I have changed the mode using that Thing before and it worked at some point or at least appeared to. But I pretty much never try to do stuff from the LCD so I can’t say whether or not it works when commanding the mode from the LCD like that. But it should.
When you change the mode using the LCD it publishes to the stat topic. The stat topic is subscribed to as a stateTopic on the Hestia OH so that will cause the binding to postUpdate the HeatingMode Item to the new state. The HeatingMode Rule triggers on change instead of command so it will trigger the Rule on the HestiaPi OH no problem.
The HeatingMode Thing on your main OH though would not have received the message because it’s subscribing to the cmnd topic for the stateTopic. So this is probably where it’s breaking down. You need to subscribe to the stat topic in order for your main OH instance to see the updates published from the LCD.
Now, let’s consider the other direction and you want to send the command to the Hestia from your main OH instance. You sendCommand to the HeatingMode Item on your main OH instance which then goes to the binding. The binding publishes the command to the stat topic (topic linked to commandTopic). Your HestiaPi OH will see that message since it subscribes to the stat topic and it’s HeatingMode Item will change state which will trigger the Rule and the heating will turn on. So far so good.
But the LCD won’t change because the LCD doesn’t subscribe to the stat topic, it subscribes to the cmnd topic.
I’ve not looked at this thoroughly yet but I think the following will work. On your main OH instance, configure your Thing exactly the same as the HestaiPi’s Thing: commandTopic to the cmnd and statetopic to stat. Then we will assume that the One UI will publish the result of it processing the command to the stat topic for us. So the flow will be:
- Main OH publishes to cmnd topic
- One UI processes message, changes its state and publishes the change in state to the stat topic
- HestiaPi OH receives the message from the stat topic, changes the state of HeatingMode which kicks off the Rules to activate the new mode.
One thing to remember is HestiaPi has OH deployed to a RPi 0 which is far below the minimum recommended specifications for running OH. That’s why it takes 20-30 minutes for the HestiaPi to book and become usable. Parsing and converting the text configurations is processor intensive and the RPi 0 only has one very low powered core. So it takes a good deal of time to parse the text configs and almost half of that 25-30 minutes is loading and parsing the .rules file alone. It takes a lot less work for the JSONDB files because it is almost just a matter of mapping the files into memory and it’s done, no parsing and very little syntax checking required.
Given this extreme amount of time required to boot, it’s worth the loss of some of the convenience (for developers) and features (that HestiaPi isn’t using anyway) that cause the recommendation for using text configs for everything but Things for general OH not the best choice for HestiaPi. So I’ve been working to move everything (including Rules) to JSONDB and so far I’m seeing very good results. The time from the blank white screen on the LCD to a working HestiaPi is almost exactly 10 minutes for me right now. It could be faster but there is no working System started Rule trigger for JSONDB Rules right now that I can use to trigger the initialization Rule to run. If I had that I could shave another minute or two off the boot I think as we don’t have to wait around for the load to drop before allowing the rule to be loaded and run the initialization.
Another advantage JSONDB everything has for users is you can see and change just about anything you would want to through PaperUI. Imagine being able to change the rule that determines when to turn on/off the heater to use a hysteresis in the calculation without needing to edit the files, and it takes effect immediately without a 10 minute wait while OH parses and loads the new .rules file. That’s what I’m trying to achieve. And I’m very close. There are a couple of small quirks with how the LCD is behaving I want to iron out and I want to add a check to not allow Cooling Boost mode to turn on when it’s already Heating and visa versa.
Some things though can only be done in text configs, including sitemaps. The Items linked to the GPIO binding also must be in .items files.
Anyone who wants to alpha test what I’ve done let me know and I’ll see if I can get it to you. It will require a bit of work to install though because you will need to stop OH, remove some files and copy some more file to another folder.