Hi all,
I see that @grumpy is rather happy with the solutions of @waaren, given in the previous post.
However, I still have some remarks, as I feel that it does not answer @grumpy 's goal, as I assume that he wants to control the Smoke Alarm (Smoke Detector) with a remote JSON command.
@waaren says in the first possibility:
If it is not already documented in the Wiki you need to search in the source.
I tested it and indeed it gives you a lot of information, not seen earlier, of (in this case) supported Smoke Detectors.
But I was unable to find to correct syntax to send a JSON command and control a Smoke Detector.
Perhaps I overlooked something, but with help of that solution, most Domoticz users are unable to control the specific switch.
The next possibility, that @waaren describes is:
Next you can define a virtual switch in domoticz and edit it on the switch tab from On/Off to Smokedetection
Check the database for the changed device and you will see something like
Indeed if you do that, you will see:
Code: Select all
[herman@asterix Domoticz]$ sqlite3 domoticz.db
SQLite version 3.34.0 2020-12-01 16:14:00
Enter ".help" for usage hints.
sqlite> select id,switchtype,type,subtype,svalue,nvalue from devicestatus where id = 11;
11|5|244|73|100|0
sqlite>
But how many will understand what the sequence "11|5|244|73|100|0" means? And, if I understand, how can I correctly control this Smoke Detector?
Use of the DB Browser for SQlite gives the same result (see the last line):

- Screenshot_DB_Browser.png (66.34 KiB) Viewed 1455 times
The solution that comes closest to the goal is the third possibility, offered by @waaren.
Clicking the smokedetector on the device tab while opened the developer console on the network tab of your browser will show you the JSON for activating the detector
I have not been able to find the right command in the "network" tab. I have tested it with Google Chrome and Mozilla Firefox under Linux.
I finally found it under the "Console" tab and "Requests" tab.

- Screenshot_commands.png (21.97 KiB) Viewed 1455 times
In addition to what @waaren wrote you can also use the passcode (of that switch). I assume you need it, if the switch has been set to protected.
I think that is recommended for a Smoke Alarm.
You will also have noticed that there is a "level΅.
What does that level represent? I think that is one of the questions @grumpy wants to know, if you want to control this switch with a remote command.
Do they expect a value from 0-100? (I think they do, but I'm not sure.)
In the source code, you will find that for a detector the obscuration is expressed in %/feet, which is fine for the UK, but uncommon in the rest of Europe. For optical smoke detectors and smoke alarms the sensitivity and smoke density is expressed in dB/m
I think it is important to know what that "level" represents.
I focused specifically on the Smoke Detector, as I expect that many Domoticz users in the next 1.5 year want to connect their Smoke Alarms to Domoticz, as new building legislation will come into force in The Netherlands from July 1, 2022, and in all homes, also built before 2003, Smoke Alarms will become mandatory.
I know, Domoticz is open-source and we cannot expect that a few developers do everything. I expect also that other switches, sensors, etc have undocumented features. We should improve Domoticz together and perhaps we can get these undocumented features clear and add it to the Wiki.
Are their ideas to get these undocumented features clear? With some guidelines/ideas I'm happy to support, because I have to be at home as much as possible (according to our prime minister

)
Regards