Closed lucaesse closed 1 year ago
Solved by myself
Hi, Lucaesse Can you explain how you solved? My small advance was by creating two switches, one for Siren On and one for Siren Off, both with these parameters for SetOn. Unfortunately, the switches stays on until I can set by parameter.
The SirenOn switch> "setOn": { "topic": "zigbee2mqtt/Siren/set", "apply": "return JSON.stringify({\"warning\": { \"mode\": \"emergency\", \"level\": \"high\", \"strobe_level\": \"high\", \"strobe\": true, \"strobe_duty_cycle\": 10, \"duration\": 180 }})"
The SirenOff switch> "setOn": { "topic": "zigbee2mqtt/Siren/set", "apply": "return JSON.stringify({\"warning\": { \"mode\": \"stop\", \"strobe\": false}})"
I would like to see if I can use a single switch that can set the above mentioned on and off payloads, but I'm struggling to find how. Maybe adapting this toggle.js functionality: https://github.com/arachnetech/homebridge-mqttthing/issues/280 Thank you!
Hi, sorry for the long wait. I solved with this config:
{ "type": "switch", "name": "Sirena", "url": "mqtt://192.168.3.8:1883", "topics": { "setOn": "zigbee2mqtt/Sirena/set" }, "onValue": "{\"warning\":{\"duration\":3600,\"level\":\"very_high\",\"mode\":\"burglar\",\"strobe\":false,\"strobe_duty_cycle\":1,\"strobe_level\":\"low\"}}", "offValue": "{\"warning\":{\"duration\":60,\"level\":\"low\",\"mode\":\"stop\",\"strobe\":false,\"strobe_duty_cycle\":1,\"strobe_level\":\"low\"}}", "history": false, "manufacturer": "Meian", "model": "TS0224", "serialNumber": "TUYA-TS0224", "accessory": "mqttthing" }
It's a single switch with ON/OFF on tap.
Hi, I have this siren https://www.zigbee2mqtt.io/devices/TS0224.html#tuya-ts0224 and I need to expose it as a switch or two for on and off but I don’t know how to do it. Can somebody help me?
This should be ON: {"warning": {"mode": burglar, "level": low, "strobe_level": high, "strobe": true, "strobe_duty_cycle": 10, "duration": 3600}}
and this should be OFF: {"warning": {"mode": stop, "level": low, "strobe_level": high, "strobe": false, "strobe_duty_cycle": 10, "duration": 3600}}
both published on topic: zigbee2mqtt/Sirena/set