kgz.me - Klaus Zanders

Thoughts of a random guy on the internet. Doing things with software ... or video

Home Assistant History Map

February 7, 2025 1 min read Code-Snippets
Original source: https://userbag.co.uk/development/home-assistant-exploring-location-history/ HACS Repos: https://github.com/nathan-gs/ha-map-card https://github.com/thomasloven/lovelace-card-mod views: - type: panel title: Historische Karte icon: mdi:map cards: - type: grid square: false cards: - type: energy-date-selection card_mod: style: | ha-card { z-index: 1; position: absolute; height: 80px !important; width: 80%; top: 75px; right: 10px; max-width: 450px; } - type: custom:map-card history_date_selection: true card_size: 10 entities: - entity: device_tracker.some-device color: red card_mod: style: | ha-card { margin-top: -10px; } ha-card #map { height:calc(100vh - 56px); border-radius:0; } columns: 1

PostgreSQL - enforce only one column filled via constraint

August 8, 2023 3 min read Code-Snippets
Recently I got a task, that required me to ensure that of two columns, either none, or only one get filled. That should be ensured on the database level. In my #ruby code it would be easy to add a validation to check for this, but as we are doing manual inserts into the DB, we need to also make sure, that the database enforces this constraint. Luckily, postgres has a feature for us, that was introduced in version 9. Continue reading

Welcome Again

October 4, 2019 1 min read
This is another try on a reboot of this blog … Let’s see if this is works this time ;) Enjoy, Klaus