Invert text and icon for sensor data

I have an older Fibaro door/window sensor (FGK10x) with external button (reed switch) attached.

I use it to detect if the door is locked or not. Unfortunately I didn’t think when I installed it and did the cable installation, so now I can’t change the polarity for the cable, without destroying everything.

I wonder can I some how invert what the sensor report, either in z-wave or byt some script or something.

Now it say Off and shows a blue circle when the door is locked, and yellow icon and text on when the door is unlocked. can I invert that. so when door is locked to say On (or Yes) and the yellow icon, and when the door is unlocked to say off (or No) and the blue circle?

See the pictures for more info

Create a Template Binary Sensor.

For its value_template, invert the state of the fibaro sensor. Normally it would check if the state is on, for your purpose it should check if the state is off.

value_template: "{{ states('binary_sensor.fibaro') == 'off') }}"

In addition, add this option:

device_class: door

Example:

binary_sensor:
  - platform: template
    sensors:
      front_door:
        friendly_name: "Front Door"
        value_template: "{{ states('binary_sensor.fibaro') == 'off' }}"
        device_class: door
device_class: lock

Might be more suitable.

  • If the reed switch is being used to detect the deadbolt’s position (locked/unlocked) then, I agree with you, lock would be optimal.

  • If the reed switch is used to detect the door’s position (open/closed) then door is preferable.

  • If the reed switch is detecting the door’s position but describing it using words “Locked/Unlocked” then that’s a misapplication of the terminology.

1 Like

I was assuming that this was correct and not referring to the door position:

but language is a tricky thing which is why I included the qualifying ‘might be’.

I have installed an external reed switch where the lock goes into the door frame, so then I know if the door is locked or not. It doesn’t monitor if the door is closed or not, it monitors my lock.

So device_class: lock is what you should use then.

I have an FK101 and use the extra contacts in a similar way. There is a zwave config option to make the contacts normally open or normally closed, Its Config Parameter 3 - Type of input no. 1. I used HA’s zwave config panel to change it.

Actually, looking at the manual for a FK10x its parameter 2