Recently I installed a number of new power sockets (like this one). The Hue bridge can not only add each switch to a light group, but also reports each plug as a Thing in openHAB. There I thought it will be a nice touch if openHAB actually reports when it sees a device plugged in. The power socket has a LED which turns on when the plug is on. The Hue bridge reports OFFLINE and ONLINE. That's useful.
The plan is to turn the LED light - and the power plug - on and off for a few second.
Continue reading "Online indicator for remote controllable power plugs in openHAB"
In one of my openHAB rules I'm using a timestamp to track when an Item went offline. This is used in my monitoring to let the user (me) know how long the Item is already offline.
Background: we have a couple ChromeCasts in our network. When they are connected to a 5GHz Wi-Fi they are quite unstable and often loose the network connection. Usually the openHAB binding reconnects the device quickly, but it happens that the device stays offline. It might have something to do with the router, but nevertheless I want to know when things go offline.
For this I defined a virtual Switch as DateTime:
DateTime LivingRoom_OfflineSince "Offline Since [%tY-%tm-%td%tH:%tM:%tS]"
When the ChromeCast goes offline, this Switch is updated in a rule with the current time:
LivingRoom_OfflineSince.postUpdate( new DateTimeType() )
However resetting the DateTime switch when the item comes back online proved to be a small challenge, the documentation is unclear. People write online about "UnDeftype", "UNDEF", "(unknown)", "UnDefType.UNDEF", "UnDefType.NULL" and a couple more.
In the end it's quite easy:
Just update the Item with NULL. Don't use sendCommand() here, you only want to update the Item, not send a new command to a virtual switch.
The openHAB rule system is not very helpful by pointing out when it's missing something, or when there is an error to actually point to the problem.
Was debugging an error message for a while and couldn't figure out what is wrong:
Configuration model '....rules' has errors, therefore ignoring it: [152,5]: no viable alternative at input '...'
The line number specified was somewhere else in the file, and had nothing to do with the rule in question. After removing almost everything from the rule, except a logInfo() message, the error still happened - and then it occured to me: I forgot to specify "Item".
My faulty code was:
rule "Rule Name"
Sensor_name received update
where it should have been:
rule "Rule Name"
Item Sensor_name received update
Error message totally not helpful ...
openHAB can integrate Google Calendars. The functionality is kind of limited, it can only see the current and the next calendar event, but in my case that is enough. More about the use case in another blog post.
There are three different calendar bindings available, let's have a quick look:
- CalDAV Personal Binding: this is a v1 binding, which means it will no longer work in the soon-to-be-released openHAB v3. Apparently this works with Google calendars, but has performance issues. It can show the current and next event.
- Google Calendar Scheduler: also a v1 binding. Needs more work for presense simulation, and additional bindings.
- iCalendar Binding: v2 binding, should work with v3. It can show the current and next event. That's the one I'm going to use.
Continue reading "Add a Google Calendar to openHAB"
openHAB rules files are lazy loaded. When a rule is used the first time, the entire rule file is loaded and compiled, which apparently is single-threaded and takes a couple seconds. Even on a reasonable powerful Rasperry Pi 4. This happens both after restarting openHAB and after changing the rules file. It also means that whatever the rule in question is supposed to do has to wait a couple seconds when requested for the first time. Imagine you have a light switch, enter a room, press the switch, and it takes 5-10 seconds until the light comes on.
To work around this problem, I add a piece of code in all rules files which triggers an immediate action right after loading the file. This way the rules file is already pre-loaded (which again takes a couple seconds, but likely at a time when the rule is not needed right now).
Continue reading "openHAB: faster loading of rules files"
A while ago someone mentioned "reminders" used in their home audio system, and I took that idea and implemented something similar in openHAB.
The basic idea is that I can send scheduled notifications to any audio sink openHAB is using, possibly more than one audio sink for one message. Also I want to differentiate between a simple audio sound, and text output.
For the text audio output I installed Text-to-Speech a while ago, this enables the ability to output text as audio in different languages. In addition I want an information when a reminder is "fired" in my Telegram control channel. As audio sink I'm mostly using ChromeCasts here, but anything openHAB can connect to is usable here.
Continue reading "Audio reminders in openHAB"
A while ago I integrated DWD warnings (Deutscher Wetterdienst) into our home automation system, and receive severe weather notifications ever since then. That works quite good, but it was missing a weblink with more details - or if you want to forward the warning to someone it would be useful to have a link to the warning as well. The DWD binding does not provide that piece of information, but it is easy enough to add - or so I thought.
Continue reading "openHAB, Telegram Bot and quoting URLs"
In my ongoing endeavor to improve our home, a while ago I added a notification when the washing machine and the dryer are finished. The notification is send to a Telegram channel. Over the summer vacation I added a number new ChromeCast Audio devices (Google no longer offers the Audio CC, if you need one get one now). One is placed in the kitchen. Not only can I listen to music while eating breakfast, I can also output notifications, by using the CC as an audio sink in openHAB.
To make that useful, I decided to use a Text-to-Speech system. openHAB offers a couple different TTS systems, however most of them need a cloud integration, and therefore a working Internet connection. The "Pico TTS" works standalone, and was my favorite choice for this implementation.
Continue reading "Text-to-Speech in openHAB"
In my previous blog post about "Tankerkönig" I explained the details of how to integrate this binding into openHAB and provide a Telegram interface.
Someone on the openHAB community forum pointed out that Telegram bots allow queries, where one can present the user with options, and the user only has to click on one of the options. That makes it easier to use, and less typing is required as well. I went ahead and implemented that.
Continue reading "openHAB and Tankerkönig gas prices + Telegram integration - Second iteration"
My plan is to reinstall openHABian on a bigger SDcard, and on a Raspberry Pi 4. The latest release (v1.5) supports the new Pi 4, and I decided it's time to do a fresh install, and see if all my Playbooks are still working.
Raspberry Pi 4 with Sectronics Armor (cooling) Case
As always, I'm searching my shell history for the right command how to install the image ... but came up empty.
Continue reading "Install openHABian image on Linux"