Page 1 of 1

Read only (dummy) switch?

Posted: Monday 01 January 2018 1:59
by AngularSpecter
I'm working on a project to sniff the door and window sensors that are part of my (unused) security system with an SDR and then publish the states to Domoticz via either the http API or MQTT. I set up a dummy device, added in new virtual switches and changed them to "Door Contacts". This sets up the device just fine, but I am able to change the state of the device by clicking on it....which doesn't make much sense if it is only showing the measured state of the door (I can't command the door to be remotely closed).

Is there a way to make the switch read only? It seems like some of the items (like the motion sensor) are set up like this already. Do I need to write a custom type?

Re: Read only (dummy) switch?

Posted: Monday 01 January 2018 8:13
by ben53252642
Make it a protected switch, then you would be prompted for a password when trying to change it (so you can't just click it).

Click edit under the switch and you will see the protected option.

Re: Read only (dummy) switch?

Posted: Monday 01 January 2018 18:13
by AngularSpecter
That sort of seems like a hack. I'd rather it be an actual indicator with no option of interaction, even if I have to put some work into making it work.

Re: Read only (dummy) switch?

Posted: Monday 01 January 2018 18:23
by jvdz
Would a Text Sensor do the job for you? This isn't modifiable via the Web interface.

Jos

Re: Read only (dummy) switch?

Posted: Monday 01 January 2018 23:45
by AngularSpecter
That looks a lot closer, but the lack of an icon is sort of a bummer.

What are people using for door and window switches? I can't imagine I'm the first person to do this

Re: Read only (dummy) switch?

Posted: Tuesday 02 January 2018 16:39
by jvdz
Have you actually tried to Edit the dummy switch and selecting a "Door contact" as type?

Jos

Re: Read only (dummy) switch?

Posted: Wednesday 03 January 2018 3:54
by AngularSpecter
Yep, that's what I'm using now. It allows me to manually change the state through the App and the UI. It also totally ignores the "Battery" property I'm also sending.

Re: Read only (dummy) switch?

Posted: Wednesday 03 January 2018 11:13
by jvdz
I can't change it in the domoticz UI (Web interface) when set as Door Contact. The Andoid app indeed shows it as regular switch which might be something that you need to take up with the developer of the app as it seems different in behavior than Domoticz.

Jos

Re: Read only (dummy) switch?

Posted: Wednesday 03 January 2018 13:34
by AngularSpecter
Interesting. What version are you running? I can click on the door icon and it switches between open and closed.