from HABApp.openhab import transformations
TEST_MAP = transformations.map['test.map'] # load the transformation, can be used anywhere
print(TEST_MAP['test_key']) # It's a normal dict with keys as str and values as str
# if all keys or values are numbers they are automatically casted to an int
NUMBERS = transformations.map['numbers.map']
print(NUMBERS[1]) # Note that the key is an int
Sending scheduler datetimes to an item:
job = self.run.on_sunrise(self.my_function)
job.to_item('item_name') # can be openHAB item or HABApp internal item
@Spaceman_Spiff - Thank you! I’ve got it loaded on my test system. On the road right now but working as I can during time off. I had to take about a month off so I may not be totally up to speed on the state of HABApp affairs, but noticed that there is now Transformation support, which is great. Guessing that Actions are not yet available, or did I miss that update? Your work is incredible.
Its great to have search available in the docs! Also, what does this mean: Support sending scheduler datetimes to an item
I must be really missing something because I am not aware of scheduler datetimes?
If you use the scheduler and want the next execution date in an item there is now an easy way for it.
This code snipped will run the my_function every day on sunrise and additionally post the next time of execution to an item.
# Scheduler as usual
job = self.run.on_sunrise(self.my_function)
# This is new
job.to_item('item_name') # can be openHAB item or HABApp internal item
Very nice. I need to figure out how I’d use that in my current setup.
On the last flight I was on (somewhere over the Mediterranean or Sinai) I got a custom logger working that I will post code example for soon. I know there have been some questions about making one of those, and I’d like to know if I did it correctly.
I have a rule in place that prevents from moving the shutters up when they would close anyway in 30 mins. I’ve implement it a long time ago but this new function makes it much easier.
Just an hour ago stopped my 1.1.2 docker container and started the new 23.09.1 image.
Amazingly everything is working perfectly as before.
Have to spend some time to see what’s everything new in this release.
Nice job done @Spaceman_Spiff
Very nice. Would you care to show it as an example as I am about to take the switch from DSL to HABApp and my first target is a cool automation of my window blinds…