Custom Component: Hubitat

Not too much yet but Iplan on slowly adding docker containers so I wanted room for growth. The MAIN reason I went to NUC (other than for my cameras) was for hard drive write speed and resiliency. The sdcard issue was mentioned many times…don’t want to deal with that headache later. I plan to setup Influxdb and grafana for my database. The HA database and graphing leaves a lot to be desired for me. I want this all on one box.

Btw, there are apparantly older model NUC at good prices on ebay. I don’t buy off ebay but others on this forum seem to recommend it often.

This is entirely why my Pi has been sitting in a drawer for the last couple of years. I was logging data from Hubitat with it and had 2 SD cards go bad within a couple of weeks and decided it was too flakey to trust. I could have enabled its USB boot mode, or just plugged in a USB drive and logged to that, but I had this Mac mini sitting around not doing much.

Ahh yes…it wasn’t “this” but “self”. I know it’s probably simple to understand if you put a little effort in but I’m lazy on the coding these days.
Pretty awesome that it reloads automatically. That’s one of the things I hated about HA at first. Change a line of code…restart hassio…sucked. Gotten a lot better with the recent upgrades but still a pain. Thankfully I don’t need to do many chnages that require a restart anymore, but in the beginning, while using a pi…sheesh. Then with zwave changes… :cry: My Nuc was heaven sent after that.

I considered that too but on the pi I felt like I would become I/O constrained in no time (USB speed was far from ideal). Might as well put it on better hardware up front instead of getting in deep and then trying to migrate.

This is the main annoyance of developing an integration for HA. So many restarts. I can’t imagine how much more painful that would be on a Pi vs my Mac.

It’s all about what you like. :slightly_smiling_face: Writing software is my hobby, and I live in a terminal, so I’m all about code.

1 Like

If I could I would. The laziness isn’t so much in the writing of the code but in the learning of how to write it. Especially for someone like me that has to try 10 things before learning the right way to do it. Time consuming task for a faux coder.

Well, if you ever do want to expand your coding horizons, Python is one of the easiest languages to pick up (relatively simple syntax, very little boilerplate, few mysterious symbols), and home automation is a great area to play in because you can really see the fruits of your labor. :grin:

1 Like

It’s a time constraint for me. I learn languages like popping chewing gum bubbles. Having recently been promoted to officer has me buried in work constantly. I miss slinging code.

Congratulations on the promotion. You now make more money but less per hour.

I have a request. The locks report the last_code_used on every message. So it’s impossible to distinguish if the lock was manually unlocked or if a code was used, in other words I can’t tell if the last_code_used was just used or from a previous event. Any chance you can blank out the last_code_name when the lock is manually actuated rather than a code used?

Isn’t that a fact.

Funny coincidence. I mentioned earlier that I planned to upgrade my Nuc4 to a Nuc8. It was supposed to come in on the tale end of next week. Well surprise surprise…got home and it was there waiting for me. It’s in the process of building as I type. I plan to use the snapshot to migrate. I’ll let you know how it goes when I’m done… :crossed_fingers:

Dumb question - is there a way to force the integration to re-detect a device? Like maybe delete it out of HA and have it re-add it?

Why do I ask? I have 3 door locks - 1 was discovered with battery + the lock. Two just have battery (no lock).

I want to try and get the other 2 completely working…

Oh here we go… :slight_smile:

1 Like

:rofl: :rofl: :rofl: :joy: :crazy_face:

Is this related to your Maker API question on the other forum? And Lock related? If So… RTFLMAO.

@omayhemo, I finally got done with my migration…more painful than I hoped but a few lessons learned.

Nuc to Nuc migration:

  • Fresh install of Hassio followed by snapshot import (Wipe and Restore option).
  • Took more than 10 minutes to load up and there were quite a few log errors…including database error s (I use the MariaDB addon for my hassio db). It wasn’t reinstalled despite being checked as an option.
  • Installing Mariadb did not fix. I had to uninstall and reinstall and then it work (4 reboots = 40 minutes).
  • Took another 15 minutes to figure out how to release/renew my ip address in Ubuntu (never had to before). I actually gave up and ended up deleting the lease from my pihole server and doing a full reboot of the NUC.
  • Reattached my Nortek stick and thankfully it kept the same usb path so I didn’t need to edit my config.yml.

All good now…everything loads noticeably faster in the web interface.

TLDR takeaways:

  • always setup ip reservation before connecting a new linux device to the network for the first time.
  • Uninstall/Reinstall of MariaDb maybe necessary. If using the HA db then a complete delete of the db file may be necessary as well.
1 Like

So, what should be happening is that hubitat_event events should be emitted for code-based unlocks, whereas non code-based unlocks are just normal state changes (no hubitat_event is emitted). Lock entities have a ‘last_code_name’ state because Hubitat locks have that, so I thought people might use it, but I could remove that if it’s confusing (it seems a bit iffy to me).

Restart HA. Devices and entities are detected during initialization, and if something has changed (a new device becomes available, or a new capability is added to the integration), new entities will be added or updated during integration startup.

1 Like

Also, turn on debug logging for the integration and see if anything iffy pops up.

logger:
  default: info
  logs:
    custom_components.hubitat: debug
    hubitatmaker: debug

Lol…I forgot this thread was about your Hubitat integration when I was reading Jason’s question and didnt even think of it in that context. That’s what I get for taking the thread off topic so often. :upside_down_face:

1 Like