ZW162 (Aeotec Siren 6) No siren switches Domoticz -> ZW-JS-UI

For Z-Wave related questions in Domoticz

Moderator: leecollings

rapperobert
Posts: 27
Joined: Friday 14 December 2018 14:20
Target OS: Linux
Domoticz version:
Contact:

Re: ZW162 (Aeotec Siren 6) No siren switches Domoticz -> ZW-JS-UI

Post by rapperobert »

an update for users with the same problem.
It appears to be a problem that the volume dimmer in Domoticz is compatible with a volume field in Zwave JS that does not work,
there are 2 fields in Zwave JS with volume
"[78-121-1-defaultVolume] Default volume" and
[78-121-1-volume] Volume
domotic is connected to the last [78-121-1-volume] Volume and it does not work in zwave JS so domoticz could be connected on the first mentioned.
There has been a response on GitHub and I hope they can/will resolve it now that the problem has become somewhat clear.

However, more is needed than just linking the button to a different volume field. To make the siren work, you will also need to be able to set the sound tone. and that field is not in domoticz at all.
As soon as there is more to report, I will do so here.
rapperobert
Posts: 27
Joined: Friday 14 December 2018 14:20
Target OS: Linux
Domoticz version:
Contact:

**Aeotec 6 Siren Workaround**: ZW162 (Aeotec Siren 6) No siren switches Domoticz -> ZW-JS-UI

Post by rapperobert »

**Aeotec 6 Siren Workaround**




While this solution might not be the most elegant, it works. I'm just a simple user who figured this out through trial and error. For technical support, please be aware that my expertise might be limited. However, I believe the following guide should help you get started.

**Steps**:

1. **Create 3 Dummy Switches**:
- **Sirene Sound**: A selector switch. This will be used to choose your sound, so populate it with values from 1 to 30. The first field is 0, which means no sound.
- **Sirene Control**: A standard switch. This will be used to turn the siren on or off.
- **Sirene 1 Volume Dummy**: A dimmer switch. This will be used to adjust the siren's volume.

2. **Install Mosquitto Clients on the Domoticz Docker Container**:

*Note*: You will lose these changes when the container is refreshed, so you might need to redo these steps after updating the container. If anyone knows a better solution, please share!

- Open your terminal.
- Run `docker ps` to see the container ID for Domoticz.
- Replace `[CONTAINER_NAME_OR_ID]` with the container ID in the following command:


docker exec -it [CONTAINER_NAME_OR_ID] /bin/sh

- Install Mosquitto Clients:

apt update
apt-get install mosquitto-clients

- You can now test with:

mosquitto_pub -h [YOUR_BROKER_IP] -p 1883 -t "[YOUR_MQTT_PREFIX]/sirene_aeotec_6/121/1/toneId/set" -m '{"value": 14}'
```
For example:

mosquitto_pub -h x.x.x.x -p 1883 -t "zwavejs/sirene_aeotec_6/121/1/toneId/set" -m '{"value": 14}'


- The siren should turn on. Change 14 to 0 to turn it off.
- Exit with `exit`.

3. **Domoticz Scripting**:
- In Domoticz, navigate to the script editor and create a DzVents script. Note that the broker name below is the MQTT prefix you used in Zwave JS.

Code: Select all

 return {
         on = {
             devices = { 'Sirene Control' }
         },
         execute = function(domoticz, device)
             local brokerIp = '[YOUR_BROKER_IP]'
             local brokerPort = '1883'
             local topic = '[YOUR_MQTT_PREFIX]/sirene_aeotec_6/121/1/toneId/set'
             local message = ''

             -- Get the selector level name from 'Sirene Sound'
             local sireneSoundValue = domoticz.devices('Sirene Sound').levelName
             
             -- Check the state of 'Sirene Control' switch
             if device.state == 'On' then
                 message = '{"value": ' .. sireneSoundValue .. '}'
             else
                 message = '{"value": 0}'
             end
             
             local command = '/usr/bin/mosquitto_pub -h ' .. brokerIp .. ' -p ' .. brokerPort .. '  -t "' .. topic .. '" -m \'' .. message .. '\''
             domoticz.log('About to execute command: ' .. command, domoticz.LOG_INFO)
             
             local result = domoticz.executeShellCommand(command)
             
             -- Log the command result
             domoticz.log('Result of the command: ' .. tostring(result), domoticz.LOG_INFO)
         end
     }


- For volume control, create a separate script:

Code: Select all

 return {
         on = {
             devices = { 'sirene 1 volume dummy' }
         },
         execute = function(domoticz, device)
             local brokerIp = '[YOUR_BROKER_IP]'
             local brokerPort = '1883'
             local topic = '[YOUR_MQTT_PREFIX]/sirene_aeotec_6/121/1/defaultVolume/set'
             
             -- Get the dimmer level and include it in the message
             local message = '{"value": ' .. device.level .. '}'
             
             local command = '/usr/bin/mosquitto_pub -h ' .. brokerIp .. ' -p ' .. brokerPort .. ' -t "' .. topic .. '" -m \'' .. message .. '\''
             
             domoticz.log('About to execute command: ' .. command, domoticz.LOG_INFO)
             
             local result = domoticz.executeShellCommand(command)
             
             -- Log the command result
             domoticz.log('Result of the command: ' .. tostring(result), domoticz.LOG_INFO)
         end
     }


I hope this guide is clear enough to help those struggling with this issue. The Domoticz team is working on a permanent solution, but until then, this workaround should suffice.

---

Note: Be sure to replace placeholder values like `[YOUR_BROKER_IP]` and `[YOUR_MQTT_PREFIX]` with your actual values before using the script.
Eugene
Posts: 33
Joined: Wednesday 21 December 2016 19:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ZW162 (Aeotec Siren 6) No siren switches Domoticz -> ZW-JS-UI

Post by Eugene »

Hi Guys,

Did someone manage to make this siren work in Domoticz?

I got my ZW164 siren today, added it into ZwaveJS, got devices discovered in Domoticz but can't activate the Siren from domoticz UI.I can trigger the siren from Zwave JS direct, but it seems Domoticz is missing the corresponding interface for some reason.

I am attaching subset of devices discovered by ZwaveJS and i can make sound on the Siren by flipping dropbox "[104-121-6-ToneId] Play Tone" between tone type and "off". but if you look into devices which domoticz discovered from MQTT - it is missing this option completely, it has only "Volume" from 104-121-* subset. When i try to switch or change corresponding "Volume" dimmer - nothing happens not matter what the dimmer value is or what the switch state is.

Any thoughts on the next steps i can take to make this work will be highly appreciated.

Thanks
Attachments
Screenshot 2025-01-06 233139.png
Screenshot 2025-01-06 233139.png (73.48 KiB) Viewed 95 times
Screenshot 2025-01-06 232933.png
Screenshot 2025-01-06 232933.png (93.44 KiB) Viewed 95 times
Eugene
Posts: 33
Joined: Wednesday 21 December 2016 19:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ZW162 (Aeotec Siren 6) No siren switches Domoticz -> ZW-JS-UI

Post by Eugene »

I’m trying to control a siren by sending MQTT messages to the zwave/Siren/121/6/toneId/set topic. Using MQTT Explorer, I can successfully make the siren sound by publishing {"value":1} to this topic and turn it off by publishing {"value":0}. However, when I try to send the same messages from a Lua script in Domoticz, the messages always appear under the domoticz/out topic instead of the zwave/Siren/121/6/toneId/set topic I need.

Here’s my Lua script:

commandArray = {}

if devicechanged['SirenControl'] then
print('Device SirenControl changed to: ' .. devicechanged['SirenControl'])

if devicechanged['SirenControl'] == 'On' then
commandArray['PublishMqtt'] = 'zwave/Siren/121/6/toneId/set:{"value":1}'
elseif devicechanged['SirenControl'] == 'Off' then
commandArray['PublishMqtt'] = 'zwave/Siren/121/6/toneId/set:{"value":0}'
end
end

return commandArray

I have two MQTT connections configured:

With autodiscovery, used for Home Assistant and Z-Wave devices.
Without autodiscovery, using domoticz/in and domoticz/out topics.

How can I send messages directly to the zwave topic from Lua within Domoticz? Is there a way to configure this without relying on external binaries like mosquitto_pub? Would I need to modify the domoticz/out topic or create an additional MQTT connection?
Last edited by Eugene on Tuesday 07 January 2025 15:09, edited 1 time in total.
User avatar
waltervl
Posts: 5293
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: ZW162 (Aeotec Siren 6) No siren switches Domoticz -> ZW-JS-UI

Post by waltervl »

Eugene wrote: Monday 06 January 2025 23:44 Hi Guys,

Did someone manage to make this siren work in Domoticz?

I got my ZW164 siren today, added it into ZwaveJS, got devices discovered in Domoticz but can't activate the Siren from domoticz UI.I can trigger the siren from Zwave JS direct, but it seems Domoticz is missing the corresponding interface for some reason.

I am attaching subset of devices discovered by ZwaveJS and i can make sound on the Siren by flipping dropbox "[104-121-6-ToneId] Play Tone" between tone type and "off". but if you look into devices which domoticz discovered from MQTT - it is missing this option completely, it has only "Volume" from 104-121-* subset. When i try to switch or change corresponding "Volume" dimmer - nothing happens not matter what the dimmer value is or what the switch state is.

Any thoughts on the next steps i can take to make this work will be highly appreciated.

Thanks
These missing devices could be number devices that are shown in Domoticz in the MQTT Autodiscovery Hardware gateway setup. See wiki https://wiki.domoticz.com/MQTT#MQTT_Autodiscovery_Setup

There is no function (yet) to set these from a scripting language (lua, dzvents etc).
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Eugene
Posts: 33
Joined: Wednesday 21 December 2016 19:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ZW162 (Aeotec Siren 6) No siren switches Domoticz -> ZW-JS-UI

Post by Eugene »

Thanks for detailed information, waltervl! indeed, i see non discovered devices in the Hardware setup. Is there anything i can do to help to make those devices discoverable by Domoticz?

Regarding sending the MQTT messages - i made a bit of research and it seems i need a node-red to transform the message from domoticz. Am I on the right way or is there better/smarter way to make MQTT control of the siren work?
User avatar
waltervl
Posts: 5293
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: ZW162 (Aeotec Siren 6) No siren switches Domoticz -> ZW-JS-UI

Post by waltervl »

They are discovered as number devices and therefore are being displayed in the setup part as these number devices should be used to setup devices (change timeout, change transition times etc).

If you want to directly send custom mqtt payloads from domoticz to zwave-js-ui better use mosquito_pub in Lua. But you can also use Node-Red, it has a big fan base.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Eugene
Posts: 33
Joined: Wednesday 21 December 2016 19:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ZW162 (Aeotec Siren 6) No siren switches Domoticz -> ZW-JS-UI

Post by Eugene »

so, i confirm with node-red i can achieve what i want, the attached workflow makes at least one siren sound work for me over mqtt.

waltervl, do you know by any chance if there is plan to make domoticz better supporting Aeotec devices or if there is a plan to add mosquitto_pub into domoticz docker image?

I am just trying to understand what the most feasible way forward for me with the current limitations i am facing. I am not a big fan of modifying existing container myself, also node-red seems a bit an overkill here :(
Attachments
Screenshot 2025-01-07 171324.png
Screenshot 2025-01-07 171324.png (49.48 KiB) Viewed 65 times
User avatar
waltervl
Posts: 5293
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: ZW162 (Aeotec Siren 6) No siren switches Domoticz -> ZW-JS-UI

Post by waltervl »

I believe this is discussed before. Search for Sirene on this forum or in Domoticz GitHub issues.
I suppose only when someone with programming skills has the same issue it will be solved.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest