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?
Read only (dummy) switch?
Moderator: leecollings
-
- Posts: 5
- Joined: Monday 01 January 2018 1:38
- Target OS: Linux
- Domoticz version:
- Contact:
-
- Posts: 543
- Joined: Saturday 02 July 2016 5:17
- Target OS: Linux
- Domoticz version: Beta
- Contact:
Re: Read only (dummy) switch?
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.
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
-
- Posts: 5
- Joined: Monday 01 January 2018 1:38
- Target OS: Linux
- Domoticz version:
- Contact:
Re: Read only (dummy) switch?
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.
- 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?
Would a Text Sensor do the job for you? This isn't modifiable via the Web interface.
Jos
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 5
- Joined: Monday 01 January 2018 1:38
- Target OS: Linux
- Domoticz version:
- Contact:
Re: Read only (dummy) switch?
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
What are people using for door and window switches? I can't imagine I'm the first person to do this
- 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?
Have you actually tried to Edit the dummy switch and selecting a "Door contact" as type?
Jos
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 5
- Joined: Monday 01 January 2018 1:38
- Target OS: Linux
- Domoticz version:
- Contact:
Re: Read only (dummy) switch?
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.
- 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?
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
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 5
- Joined: Monday 01 January 2018 1:38
- Target OS: Linux
- Domoticz version:
- Contact:
Re: Read only (dummy) switch?
Interesting. What version are you running? I can click on the door icon and it switches between open and closed.
Who is online
Users browsing this forum: No registered users and 1 guest