Skip to content

Text-to-Speech in openHAB

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"

openHAB and Tankerkönig gas prices + Telegram integration - Second iteration

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"

Use namespace as global variable in Ansible Jinja templates

A simple task, or so I thought: in a Jinja template keep track of the number of items in a loop. And then use that count afterwards.

Disclaimer: the number of items is not equal the number of times the loop runs, so I can't use the loop variables.

Turns out that Jinja has other opinions, and variables inside a loop are all local. When a variable is changed inside the loop, the scoop of the variable stays local, and once the loop ends the original value of the variable is restored. That's even true for variables which are created outside the loop.

 

Continue reading "Use namespace as global variable in Ansible Jinja templates"

openHAB: Turn display on and off for a Video ChromeCast

After figuring out if a ChromeCast is currently used, it was time to fix a long-standing problem. At home we don't have TVs, just "dumb" displays, and stream content using ChromeCasts. However a video ChromeCast never really turns off, but keeps the display running, using a "Backdrop" app. This app keeps showing pictures on the display when the ChromeCast is not used otherwise, effectively preventing any powersafe mode.

That's both annoying (who wants to have pictures shown in the living room or working room all night), and consumes energy. It's also intentional by Google. So far we had to turn the display on and off manually, which is inconvenient.

 

Continue reading "openHAB: Turn display on and off for a Video ChromeCast"

openHAB: detect if a ChromeCast is currently used or idle

We have a couple of Audio and Video ChromeCasts in use. For an upcoming project I need to figure out if any of them is currently used. That is different for the Audio and the Video devices: the Audio just goes idle=ON, the Video devices however load the "Backdrop" app and show pictures when idling. Google for whatever reason does not want the attached monitor to go in powersafe mode. So much for saving energy ...

All of the action needs between a few milliseconds and 2-3 seconds once you start/stop using the ChromeCast.

A previous blog post explains how I add the ChromeCast devices. And I have monitoring in place.

 

Continue reading "openHAB: detect if a ChromeCast is currently used or idle"

Deutscher Wetterdienst notifications in openHAB and Telegram

The "Deutscher Wetterdienst" DWD (German Weather Service) provices a service which sends out alarms for upcoming events, like heavy rain, storm, blizzard, strong winds ect. This service is only available for Germany. And it has a binding for openHAB. Time to integrate this, activate a number of regions I'm interested in, and send notifications to our mobile phones.

At this point I'm really happy that I deploy my openHAB with Ansible, I can use the Template module and loop over the Items, Things and Rules.

The Binding can "track" multiple regions, so called Cell IDs. I'm interested in 4 different Cells (the list is available here), your mileage might vary. For each reagion there can be multiple messages - and although every single example I found only assumes there is only one message (warningCount=1), I already had a situation where a Cell had two warnings. That information likely goes missing if you set warningCount to 1. Given how much configuration overhead it is when you add more channels, I can understand why most examples stay at "1" for warningCount. Doubling the number doubles the number of Items (12 -> 24). However since I deploy everything in a template, that's not a problem here.

I started this with a generous warningCount=5 - and in my templates I just loop from 1 to 5, and over every Cell, and generate all the necessary Things and Rules for every channel.

Ok, the details:

 

Continue reading "Deutscher Wetterdienst notifications in openHAB and Telegram"

openHAB and Tankerkönig gas prices + Telegram integration

In Germany, every gas station must report gas prices online, to the "Markttransparenzstelle für Kraftstoffe". Businesses and users can then fetch this data and provide services. One of these companies is Tankerkönig, and there's also a Binding for openHAB.

If you are interested in gas prices for certain gas stations, you need to sign up for a (free) API key, and figure out the IDs of the gas stations. For that go to this website, Position the blue marker on the location you are interested in, and then click on all the gas stations you want to include. Finally click on "Tankstellen übernehmen" - this will open a JSON with the data, from there extract the "id" (and possibly the other data as well).

 

Continue reading "openHAB and Tankerkönig gas prices + Telegram integration"

Monitor additional details in Telegraf with the "Exec" input filter

After installing Telegraf and hooking up everything into InfluxDB, I was missing the status of my backups. Every system here creates encrypted backups every night, and stores them on a central NAS, and off-site. But I want to know statistics about the backups, and see if something is not working.

I'm using Restic for the backups (will blog about this another time). However Telegraf does not support Restic directly, I need a few workarounds. This blog post however is not directly about monitoring the backups, but about how to write your own plugin for Telegraf.

 

Continue reading "Monitor additional details in Telegraf with the "Exec" input filter"