xZetsubou / hass-localtuya

🔹 A Home Assistant integration to handle Tuya devices locally "fork from localtuya"
https://xzetsubou.github.io/hass-localtuya/
GNU General Public License v3.0
291 stars 30 forks source link

Zigbee remote control for alarm activation #198

Closed goodsale closed 2 months ago

goodsale commented 2 months ago

LocalTuya Version

Master - test last version

Home Assistant Version

last

Environment

What happened?

I have a zigbee remote control that allows you to manage an alarm.

The remote control has several buttons

I can't manage PID 40 in homeassistant, I can't get the correct value.

I tried configuring it as a sensor, as an alarm, as a multiple value but nothing.

Is there a possibility to have insertion status?

Steps to reproduce.

.

Relevant log output

{
  "result": {
    "properties": [
      {
        "code": "battery_percentage",
        "custom_name": "",
        "dp_id": 3,
        "time": 1712836082010,
        "value": 56
      },
      {
        "code": "alarm_switch",
        "custom_name": "",
        "dp_id": 23,
        "time": 1710662240766,
        "value": true
      },
      {
        "code": "mode_arm",
        "custom_name": "",
        "dp_id": 40,
        "time": 1710798588953,
        "value": "armed_staying"
      }
    ]
  },
  "success": true,

}

Diagnostics information.

.

xZetsubou commented 2 months ago

Maybe the device doesn't report that, post the device diagnostic, you can download it from the device page in your home assistant.

goodsale commented 2 months ago

lovaltuya Telecomando1.json

xZetsubou commented 2 months ago

I think your devices doesn't report the id 40 value in initialization however I think it will do if the state changed of it later after you add and the device state changed localtuya may actually catch the change report and store it in HA however if the device reconnect or integration reloaded the state will gone again.

I would suggest you to add 0 in manual DPS this will enable restore old state form Home Assistant at initialization. then trigger the dpid by change the mode for once.

close edit: if there's more questions feel free to ask.