ads' corner

openHAB: timestamp from last Item update

If openHAB has a Persistence service configured, the time of the last Item update (and a couple other times) is available in Rules. This makes it quite handy to check if a certain item hasn't been updated in a long time.

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.

Most of the implementation does not change, especially all the Things and Items are the same. The Rules change however.

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).