Hi, I am in the middle of the process of getting rid of the file based configuration. Please don’t discuss why, I just want to simplify the system.
Things, Items, Persistence etc I have already migrated everything.
I am currently trying to transfer the more than 120 DSL-based rules into UI rules as far as possible. And where possible not to inline scripts to keep it as simple as possible.
I have the question of whether it is possible to insert an item value into the output of a Telegram message.
This is how it worked in a DSL rule:
"Battery over 20 per cent, power generation %s. Right time to switch on washing machine, dryer or dishwasher.", Energy_PVoutput.state
Can I also insert something like this in the UI? What would be the syntax for this?
No I don’t think that’s possible. You’ll need to use an inline script.
But if you want something half way between basic UI rules and inline script code, you might consider a look at Blockly. A lot of people who do not already understand code find it easier to work with than text based coding.
Thank you for the clarification.
I’ll see where I can’t do without it, but I’ll use Javascript instead. With Blockly, I’m cautious about what will happen if it is deprecated at some point.
That’s exceedingly unlikely to happen. It’s far too popular and it’s pretty easy to work with an maintain. It’s more likely that JS becomes deprecated some day than Blockly (and I’m not saying JS is in dandger of becoming deprecated).
Also, Blockly “complies” to JS so it makes a decent way to learn how to code rules in JS if nothing else.
Thanks for clarification.
I’ve transformed most of my rules to UI rules. No problem for the the most rules.
But: i’ve a “settings” area in my openhab, where i could set some values in the UI and not in code. To use this “settings” i had use something like this in DSL:
Temperatur_KG_Buero_Set.sendCommand(Temp_KG_Buero_Set_absent.state as Number)
Temperatur_KG_Flur_Set.sendCommand(Temp_KG_Flur_Set_absent.state as Number)
or in IF:
if ((Temperatur_KG_Buero_Set.state as Number) != (Temp_KG_Buero_Set_present.state as Number)) {....}
I tried this in UI rules with no success. For example i add a “But only if” to compare to states:
Because the developer tool shows this syntax to get values from a item, i hopped it would work, so i fill the “State” with “=items.maxOpenFenstertemp.State”. Is something like this possible?
For a workaround i actually use inline script with my old DSL syntax. It works fine and yes, i could change it to javascript, but pure UI would be easier for my son to work with