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. As example I have the Tankerkoenig Binding installed, and this data is persisted in InfluxDB. This way I can see historic gas prices in Grafana.
When the Telegram Bot answers the "/tanken" question, it appends the timestamp of the last gas prices update.
Continue reading "openHAB: timestamp from last Item update"
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"
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"