Read only (dummy) switch?

Moderator: leecollings

Post Reply
AngularSpecter
Posts: 5
Joined: Monday 01 January 2018 1:38
Target OS: Linux
Domoticz version:
Contact:

Read only (dummy) switch?

Post 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?
ben53252642
Posts: 543
Joined: Saturday 02 July 2016 5:17
Target OS: Linux
Domoticz version: Beta
Contact:

Re: Read only (dummy) switch?

Post 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.
Unless otherwise stated, all my code is released under GPL 3 license: https://www.gnu.org/licenses/gpl-3.0.en.html
AngularSpecter
Posts: 5
Joined: Monday 01 January 2018 1:38
Target OS: Linux
Domoticz version:
Contact:

Re: Read only (dummy) switch?

Post 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.
User avatar
jvdz
Posts: 2335
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Read only (dummy) switch?

Post by jvdz »

Would a Text Sensor do the job for you? This isn't modifiable via the Web interface.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
AngularSpecter
Posts: 5
Joined: Monday 01 January 2018 1:38
Target OS: Linux
Domoticz version:
Contact:

Re: Read only (dummy) switch?

Post 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
User avatar
jvdz
Posts: 2335
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Read only (dummy) switch?

Post by jvdz »

Have you actually tried to Edit the dummy switch and selecting a "Door contact" as type?

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
AngularSpecter
Posts: 5
Joined: Monday 01 January 2018 1:38
Target OS: Linux
Domoticz version:
Contact:

Re: Read only (dummy) switch?

Post 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.
User avatar
jvdz
Posts: 2335
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Read only (dummy) switch?

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
AngularSpecter
Posts: 5
Joined: Monday 01 January 2018 1:38
Target OS: Linux
Domoticz version:
Contact:

Re: Read only (dummy) switch?

Post by AngularSpecter »

Interesting. What version are you running? I can click on the door icon and it switches between open and closed.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest