Support iButtons in onewire integration

There are so called iButton devices (based on the DS1990 chip AFAIK) available for the 1-wire bus, which are popular as cheap but secure ways to implement access control, e.g. disarming your alarm system. We have the onewire integration that supports integrating 1-wire devices like temperature sensors into HA, but support for these particular chips is missing.

What’s different to other sensors is the fact that these iButtons are not always connected to the bus. And they don’t have an intrinsic value you want to get out of them. Rather the bus should be polled (in a higher frequency than for regular devices!) for the presence of these, and that information should be mapped to a boolean sensor in HA to be able to trigger other automations (e.g. alarm).

Btw, having migrated my smarthome system from OpenHab to HA, this is a key missing piece for feature parity for me, as OH does have support for iButtons built-in.

I believe you can integrate your devices with this if you’re familiar with ESPHome:

Thanks, but that seems out of scope for me. I already have the 1-wire bus connected to an USB master and owserver, which the onewire integration is reading from. I can’t change that, for all the other sensors (temperature) in use.

it looks like ESPHome is one-way solution for your project

I ended up writing a simple node.js script running on my raspberry pie in docker that pulls the presence information of those ibuttons from the existing owserver, and posts any changes to an HA webhook. That is used for a trigger based template entity like this:

- trigger:
    - trigger: webhook
      webhook_id: ibutton_<name>_<something-hard-to-guess>
  binary_sensor:
    - name: "iButton <name>"
      state: "{{ trigger.json.value }}"
      device_class: presence

That entity now reflects the presence status of my ibutton, used for any further automations.

My node script, in case someone wants to replicate this: GitHub - simonihmig/owfs-webhook

1 Like