Reverse orientation of garage tilt sensor?

I’ve got a 3rd reality zigbee garage door tilt sensor. I want to use it to detect the opening closing of a dairy delivery box on a covered porch. I neglected to realize when I ordered it that it would default to showing open/closed based on the sensor being stuck vertically to a door. I want to stick this horizontally on the top of the lid.

Is there a way in HA where I can alter how the sensor’s open/close it handled? I’d love to be able to continue to address it as being opened or closed. I could, of course, just ignore the state, but I’m wondering how deeply I can go in the configuration to reverse the state so that anything else treating it as an open/close can see it the way I want.

I’ve just never poked around into the basic configuration of a device and don’t know where I’d start.

Otherwise, yeah, I can of course just structure automations and UI around reversing it, but I get the impression it’d be nicer to do this from the device level instead.

I’ve posted on their support forums to ask about this as well.

What values does the sensor report? Open/closed?
You should be able to do anything you like once the value changes and is reflected in HomeAssistant reliably.

Orientation of the sensor is not going to be reflected in the device integration values, is it?

You got a tilt sensor when a simple door/window sensor would have accomplished what you want with half the fuss.

Look up a custom integration called spook. I believe it has a built-in option to invert the state of a sensor.

Home assistant itself will only allow you to create a new entity.

Integrations are responsible for creating and controlling entities, so your only hope of actually changing the existing entity is if the Zigbee device allows different functionality through some programmable parameter.

Even the spook integration’s helper is just a more simple way of creating a new entity (it just makes it so you don’t have to type the templates I’m going to show you later in the next paragraph).

But creating a new entity isn’t a big deal. Just hide the existing entity (if you want) and create a template binary sensor helper that uses this for the state template:

{{ is_state('binary_sensor.my_zigbee_tilt_sensor', 'off') }}

If you want to copy the zigbee sensor’s availability, you can enter a template for the availability too (under “advanced settings”):

{{ has_value('binary_sensor.my_zigbee_tilt_sensor') }}

I have the same device, you can change the orientation on the device itself. I found the instructions with a quick Google search.

Care to share that? Because I generally do sftw before asking questions and did not come across anything useful, nor in the manual. The only thing changeable on the device itself are dip switches that can change the detection angle sensitivity, not the orientation and a siren function (which does not appear to be exposed in the zigbee interface). Turning the siren to the 1-on position does not seem to do anyhing.

I asked the vendor on their support forum. Their advice, which included all details on how, was to tell the device to recalibrate itself, but not quite. The recalibration has to be done in the different orientation (standing on it’s end, not flat).

For anyone else coming along later, looking to use this for a box instead of a garage door,

  1. Open the unit, find the small button on the circuit board.
  2. Turn it on then end you want to indicate as ‘open’ facing down
  3. Quickly press the button inside 5 times

The light will go solid for 3 seconds (do not move it during this) and it will store the new orientation.

For regular use on a garage door you’d calibrate it with the flat side facing down. That way when it’s turned ‘tall’ the door will be read as ‘closed’.

But for use on a box lid you need the opposite. You want the ‘open’ position to read when the unit is turned ‘tall’.

Note that the unit has one pivot angle. The sensor only detects one axis of change on that angle. So make sure you mount it properly.

And when you’re testing to see if your calibration changes worked, note the face of the unit has to be facing up, not the circuit board side. It only reads when the circuit board is facing down. Which is a little problematic as that requires mounting it face side up if you’re going to use it under a lid.

I tested and it does seem to retain the recalibration across battery changes.

The zigbee page for it in HA does show a ‘Calibrate Z axis’ function. I do not know if that would accomplish the same thing as the 5-button sequence or not.

Now the magic question is will it work while inside of a metal dairy delivery box on the front porch!

Second Google result: https://3reality.com/faq-help-center/?srsltid=AfmBOoqAoSwMQ7OxyqtdIQziAma6CJLhe3aFmbK7jEmKIQjodwG2dpqm

and another link: https://discuss.3reality.com/d/24-garage-door-tilt-sensor-faq.