Neo Zigbee solar Siren _TZE284_nlrfgpny

Hello,

I’m opening this post because I’ve tried configuring this siren with the MC drivers and the Personal Drivers listed for other models, but I haven’t been able to get it to work. With the help of GPT chat, I’ve tried creating my own driver. I manage to install it on the hub, but when I try to re-pair the siren, it detects me as a Zigbee Thing, and I can’t activate the driver. It seems there’s a problem with the fingerprint, or I don’t know, but any help is welcome.

To create the driver, I installed these files locally, generated from the information I gathered from the siren. The driver structure is as follows.

tuya_solar_siren_driver/
│
├── src/
│   └── init.lua            
│
├── config.yml              
├── fingerprints.yml        
└── profiles/
    └── siren-profile.yml 

content of config.yml


packageKey: tuya_solar_siren
name: Tuya Solar Siren
description: Driver for Tuya Solar Siren TS0601 (_TZE284_nlrfgpny)
vendorSupportInformation: https://github.com/tuya/zigbee

content of fingerprints.yml

fingerprints:
  - id: "tuya/solar-siren"
    manufacturer: "_TZE284_nlrfgpny"
    model: "TS0601"
    deviceProfileName: siren

content of siren-profile.yml

name: siren
components:
  - id: main
    capabilities:
      - id: switch
        version: 1
      - id: alarm
        version: 1
      - id: audioVolume
        version: 1
    categories:
      - name: Siren

content of init.lua


-- Tuya Solar Siren Driver (init.lua)

local capabilities = require "st.capabilities"

local function handle_on(driver, device, command)
  device:send(capabilities.switch.on())
end

local function handle_off(driver, device, command)
  device:send(capabilities.switch.off())
end

local function tuya_siren_handler(driver, device, command)
  if command.name == "on" then
    handle_on(driver, device, command)
  elseif command.name == "off" then
    handle_off(driver, device, command)
  end
end

local driver_template = {
  supported_capabilities = {
    capabilities.switch,
    capabilities.alarm
  },
  lifecycle_handlers = {
    added = function(driver, device)
      device:emit_event(capabilities.switch.off())
    end,
    infoChanged = function(driver, device)
      -- Handle information changes
    end
  },
  capability_handlers = {
    [capabilities.switch.id] = tuya_siren_handler,
    [capabilities.alarm.id] = tuya_siren_handler
  }
}

return driver_template

other files inside /src folder

tuya_siren_handler.lua


-- Tuya Solar Siren Handler (tuya_siren_handler.lua)

local function on_command(driver, device, command)
  -- Handle "on" command for Tuya Solar Siren
  device:send(capabilities.switch.on())
end

local function off_command(driver, device, command)
  -- Handle "off" command for Tuya Solar Siren
  device:send(capabilities.switch.off())
end

return {
  on_command = on_command,
  off_command = off_command
}

tuya_solar_siren_driver.groovy


metadata {
    definition (name: "Tuya Solar Siren Zigbee", namespace: "kkossev", author: "Krassimir Kossev", singleThreaded: true ) {
        capability "Actuator"
        capability "Battery"
        capability "Switch"
        capability "Alarm"          // alarm - ENUM ["strobe", "off", "both", "siren"]; Commands: both() off() siren() strobe()
        capability "AudioVolume"    //Attributes: mute - ENUM ["unmuted", "muted"] volume - NUMBER, unit:%; Commands: mute() setVolume(volumelevel) volumelevel required (NUMBER) - Volume level (0 to 100) unmute() volumeDown() volumeUp()
        capability "TemperatureMeasurement"
        capability "RelativeHumidityMeasurement"
        capability "Refresh"
        
        attribute 'Status', 'string'
        attribute 'alarmState', 'ENUM', ["Alarm Sound", "Alarm Light", "Alarm Sound and Light", "No Alarm"]
        attribute 'solarCharging', 'ENUM', ["not charging", "charging"]
        attribute 'tamperAlarmSwitch', 'ENUM', ["disabled", "enabled"]
        
        fingerprint profileId:"0104", endpointId:"01", inClusters:"0004,0005,EF00,0000,ED00", outClusters:"0019,000A", model:"TS0601", manufacturer:"_TZE284_nlrfgpny", deviceJoinName: "Tuya Solar Alarm"
    }
}

tuya_solar_siren_driver.yaml


packageKey: tuya_solar_siren
name: Tuya Solar Siren
description: Driver for Tuya Solar Siren TS0601 (_TZE284_nlrfgpny)
vendorSupportInformation: https://github.com/tuya/zigbee

Through MC’s Driver Thing, I’ve obtained the following information, which I’ve used to develop the driver.

Is there anything I’m missing?

Here’s a link to the product.
https://es.aliexpress.com/item/1005007022197993.html

Thanks to everyone who reads this, and if you are in my case and want to get this siren working, let’s see if we can all do it together.

Yes. A working driver.

The whole thing is something that ChatGPT hallucinated.

Take the MC siren driver, add the fingerprint, package and install it.


It is possible to create a working driver with ChatGPT, but you’d have to have a long conversation with it. If you’d ask why there’s some groovy code and why there’s no lifecycle handler and so on, it would rethink its answers.

Start with Please create a working SmartThings Edge Driver for a Zigbee temperature and humidity sensor. Then ask questions about the code and later ask it to change the code to a Zigbee siren driver.

It can take hours but you’ll learn a lot and at the end, you might be able to write your own driver.


Look at this code:

It’s very readable and you could paste it to ChatGPT and let it explain in detail what it does! After that, ask to add your fingerprint and maybe a sub driver.

Good luck!

1 Like

Your device uses the EF00 cluster.
Read through this topic

Also, google the device fingerprint in Home Assistant and Z2Mqtt to discover the datapoints to use with w35l3y driver.

That seems to be the datapoints and data types used in the ZHA integration:

TuyaQuirkBuilder(“_TZE204_nlrfgpny”, “TS0601”)
.applies_to(“TZE200_nlrfgpny”, “TS0601”)
.applies_to(“_TZE284_nlrfgpny”, “TS0601”)
.tuya_enum(
dp_id=1,
attribute_name=“alarm_state”,
enum_class=TuyaSirenState,
entity_platform=EntityPlatform.SENSOR,
entity_type=EntityType.STANDARD,
translation_key=“alarm_state”,
fallback_name=“Alarm state”,
)
.tuya_binary_sensor(
dp_id=6,
attribute_name=“charge_state”,
device_class=BinarySensorDeviceClass.BATTERY_CHARGING,
fallback_name=“Charging”,
)
.tuya_number(
dp_id=7,
attribute_name=“alarm_duration”,
min_value=1,
type=t.uint16_t,
max_value=60,
step=1,
unit=UnitOfTime.MINUTES,
translation_key=“alarm_duration”,
fallback_name=“Alarm duration”,
)
.tuya_switch(
dp_id=13,
attribute_name=“siren_on”,
entity_type=EntityType.STANDARD,
translation_key=“siren_on”,
fallback_name=“Siren on”,
)
.tuya_battery(
dp_id=15, battery_type=BatterySize.Other, battery_qty=1, battery_voltage=30
)
.tuya_binary_sensor(
dp_id=20,
attribute_name=“tamper”,
device_class=BinarySensorDeviceClass.TAMPER,
entity_type=EntityType.STANDARD,
fallback_name=“Tamper”,
)
.tuya_enum(
dp_id=21,
attribute_name=“alarm_ringtone”,
enum_class=TuyaSirenRingtone,
translation_key=“alarm_ringtone”,
fallback_name=“Alarm ringtone”,
)
.tuya_switch(
dp_id=101,
attribute_name=“enable_tamper_alarm”,
entity_type=EntityType.STANDARD,
translation_key=“enable_tamper_alarm”,
fallback_name=“Enable tamper alarm”,
)
.tuya_enum(
dp_id=102,
attribute_name=“alarm_mode”,
enum_class=TuyaSirenState,
translation_key=“alarm_mode”,
fallback_name=“Alarm mode”,
)

any luck getting this to work? i have the same _TZE284_nlrfgpny solar siren and ive tried with the w3sley integration for the tuya clusters and ive been unsuccessful in getting it to run properly. I was at one point able to get the siren to go on but then i couldnt turn it off. :frowning: