Pete's Log: Sunday afternoon update

Entry #1965, (Coding, Hacking, & CS stuff, Lego, Life in General, Parenthood, Starcraft)
(posted when I was 42 years old.)

Played some StarCraft with Branden and Brian this morning. My strategy of late has been to simply rush to Void Rays without building any other units. It's not terribly nuanced, but it's entertaining.

JB seems to already be getting over her cold.

Jamie's parents had gifted us a Lego RV (set 60057) many years ago, and JB enjoys playing with it. It seems to hold her attention much longer than Duplo does. So yesterday Jamie bought a Lego construction set (set 60252) for JB. JB has been super into playing with it. It says age 4+ but I figure so long as she's supervised playing with it, she'll be fine. It's definitely fun to see her so focused on something.

At lunch today JB tried pistachios for the first time and was super into them. To the extent that we had to keep reminding her there were other foods on her plate too.

Today's naptime activity was figuring out how to show the number of library visits (measured as number of times the door is opened) in Grafana. I thought I had something working already, but a visit this morning didn't get counted and I realized that my approach wasn't viable. I was counting the number of times the door state changed. But Prometheus is only scraping HA every 60 seconds and our visitor this morning only had the door open for 37 seconds and managed to evade the scrape.

My first attempt to remedy this was to create a counter in HA that is incremented by an automation each time the door is opened. But I couldn't seem to get the counter value to show up in Prometheus/Grafana. So next I tried using the history_stats platform. This lets me do a count of door open events for the past day or 7 days. But I couldn't get this into Prometheus either. Finally I found that entities without a defined unit of measurement don't seem to get exposed to Prometheus by Home Assistant. So that's probably why my counter approach didn't work either.

Anyway (and I'm recording this because I'm sure to run into this again), you can override the unit in the HA Prometheus configuration:

component_config_glob: sensor.library_visit*: override_metric: visit

That defines my library visit counts in HA to export to Prometheus with a unit of "visits" and that seems to have done the trick.

Now I just need somebody to come by and open the door.

PS: library visit count for the past week is 26.

PPS: this weekend was sunny enough that the battery is back to fully charged.