Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request support for Atorch at4pw #1038

Closed
Adam-1974 opened this issue Aug 28, 2023 · 14 comments
Closed

Request support for Atorch at4pw #1038

Adam-1974 opened this issue Aug 28, 2023 · 14 comments

Comments

@Adam-1974
Copy link

Here is a link to the json from Tuya: https://jsoneditoronline.org/#left=cloud.bcd999d58ddd4579ac00f762d849a1b2

Product ID: tjtigg991kvoiiqi

Link to instructions with description: http://en.atorch.cn/upload/20220629115640.pdf

@Adam-1974 Adam-1974 added the new device Unsupported device label Aug 28, 2023
@make-all
Copy link
Owner

make-all commented Sep 9, 2023

Useful information extracted from that dump:

The device seems to be an electricity meter from the manual.

"name":"Inteligentny licznik linii Din Rail(AT4P) 2","productId":"tjtigg991kvoiiqi"

"dps":{"1":true,"9":0,"17":0,"18":55,"19":0,"20":23092,"101":100,"102":0,"103":0,"104":2650,"105":1000,"106":26500,"107":"english","108":9,"109":3,"110":60,"111":true,"112":"controlled","113":false,"114":false,"115":false,"116":false,"117":"measurement","118":"safety_protection","119":750,"120":true,"123":30,"132":"off","133":0,"134":0,"135":0,"136":"single_rate","137":5,"138":"open","139":false,"140":50000,"141":false,"142":0,"143":30}

Seems to be a list of the dps, but not clear where this was captured from, as it is in the middle of a dump of other data that has obviously come from the cloud, so unsure whether this is representative of what will be received locally (it seems like a lot more data than is usual for this type of device)

  "1":{"code":"switch_1","iconname":"icon-dp_power2","id":"1","mode":"rw","name":"开关状态","property":{"type":"bool"},"schemaType":"bool","type":"obj"},
  "9":{"code":"countdown_1","iconname":"icon-dp_time2","id":"9","mode":"rw","name":"开关倒计时","property":{"max":360000,"min":0,"scale":0,"step":1,"type":"value","unit":"s"},"schemaType":"value","type":"obj"},
  "17":{"code":"add_ele","iconname":"icon-battery","id":"17","mode":"rw","name":"增加电量","property":{"max":5000000,"min":0,"scale":2,"step":1,"type":"value","unit":"kwh"},"schemaType":"value","type":"obj"},
  "18":{"code":"cur_current","iconname":"icon-Ele","id":"18","mode":"ro","name":"当前电流","property":{"max":120000,"min":0,"scale":3,"step":1,"type":"value","unit":"A"},"schemaType":"value","type":"obj"},
  "19":{"code":"cur_power","iconname":"icon-dp_tool","id":"19","mode":"ro","name":"当前功率","property":{"max":2800000,"min":0,"scale":2,"step":1,"type":"value","unit":"W"},"schemaType":"value","type":"obj"},
  "20":{"code":"cur_voltage","iconname":"icon-a_function_turbo","id":"20","mode":"ro","name":"当前电压","property":{"max":30000,"min":0,"scale":2,"step":1,"type":"value","unit":"V"},"schemaType":"value","type":"obj"},
  "101":{"code":"price","id":"101","mode":"rw","name":"电费单价","property":{"max":99999,"min":0,"scale":2,"step":1,"type":"value","unit":""},"schemaType":"value","type":"obj"},
  "102":{"code":"cost","id":"102","mode":"ro","name":"总电费","property":{"max":50000000,"min":0,"scale":3,"step":1,"type":"value","unit":""},"schemaType":"value","type":"obj"},
  "103":{"code":"add_cost","id":"103","mode":"ro","name":"电费","property":{"max":5000000,"min":0,"scale":2,"step":1,"type":"value","unit":""},"schemaType":"value","type":"obj"},
  "104":{"code":"ovp","id":"104","mode":"rw","name":"过压值","property":{"max":2750,"min":1,"scale":1,"step":1,"type":"value","unit":"V"},"schemaType":"value","type":"obj"},
  "105":{"code":"ocp","id":"105","mode":"rw","name":"过流值","property":{"max":1000,"min":1,"scale":1,"step":1,"type":"value","unit":"A"},"schemaType":"value","type":"obj"},
  "106":{"code":"opp","id":"106","mode":"rw","name":"过功率值","property":{"max":27500,"min":1,"scale":0,"step":1,"type":"value","unit":"W"},"schemaType":"value","type":"obj"},
  "107":{"code":"language","id":"107","mode":"rw","name":"设备语言","property":{"range":["chinese","english"],"type":"enum"},"schemaType":"enum","type":"obj"},
  "108":{"code":"work_value","id":"108","mode":"rw","name":"工作屏幕亮度","property":{"max":9,"min":1,"scale":0,"step":1,"type":"value","unit":""},"schemaType":"value","type":"obj"},
  "109":{"code":"standby_value","id":"109","mode":"rw","name":"待机屏幕亮度","property":{"max":9,"min":0,"scale":0,"step":1,"type":"value","unit":""},"schemaType":"value","type":"obj"},
  "110":{"code":"standby_time","id":"110","mode":"rw","name":"进入待机时间","property":{"max":99,"min":3,"scale":0,"step":1,"type":"value","unit":"s"},"schemaType":"value","type":"obj"},
  "111":{"code":"beep","id":"111","mode":"rw","name":"系统声音","property":{"type":"bool"},"schemaType":"bool","type":"obj"},
  "112":{"code":"sw_mode","id":"112","mode":"rw","name":"开关模式","property":{"range":["controlled","normally_open"],"type":"enum"},"schemaType":"enum","type":"obj"},
  "113":{"code":"data_reset","id":"113","mode":"rw","name":"累计数据清零","property":{"type":"bool"},"schemaType":"bool","type":"obj"},
  "114":{"code":"wifi_reset","id":"114","mode":"rw","name":"wifi设备重置","property":{"type":"bool"},"schemaType":"bool","type":"obj"},
  "115":{"code":"factor_reset","id":"115","mode":"rw","name":"恢复出厂设置","property":{"type":"bool"},"schemaType":"bool","type":"obj"},
  "116":{"code":"screen_rotation","id":"116","mode":"rw","name":"屏幕旋转","property":{"type":"bool"},"schemaType":"bool","type":"obj"},
  "117":{"code":"standby_screen","id":"117","mode":"rw","name":"待机画面","property":{"range":["original","measurement"],"type":"enum"},"schemaType":"enum","type":"obj"},
  "118":{"code":"menu","id":"118","mode":"rw","name":"设备显示风格:","property":{"range":["safety_protection","price_bill","big_data"],"type":"enum"},"schemaType":"enum","type":"obj"},
  "119":{"code":"lvp","id":"119","mode":"rw","name":"欠压值","property":{"max":2650,"min":1,"scale":1,"step":1,"type":"value","unit":"V"},"schemaType":"value","type":"obj"},
  "120":{"code":"control","id":"120","mode":"rw","name":"超限控制使能","property":{"type":"bool"},"schemaType":"bool","type":"obj"},
  "123":{"code":"ele","id":"123","mode":"ro","name":"总电量","property":{"max":999999999,"min":0,"scale":3,"step":1,"type":"value","unit":"kwh"},"schemaType":"value","type":"obj"},
  "132":{"code":"warning","id":"132","mode":"rw","name":"告警标志","property":{"range":["off","ovp","ocp","opp","lvp","le"],"type":"enum"},"schemaType":"enum","type":"obj"},
  "133":{"code":"cur_frequency","id":"133","mode":"ro","name":"当前频率","property":{"max":100000,"min":0,"scale":2,"step":1,"type":"value","unit":"Hz"},"schemaType":"value","type":"obj"},
  "134":{"code":"power_factor","id":"134","mode":"ro","name":"功率因数","property":{"max":100,"min":0,"scale":2,"step":1,"type":"value","unit":"PF"},"schemaType":"value","type":"obj"},
  "135":{"code":"cpu_temp","id":"135","mode":"ro","name":"仪表CPU温度","property":{"max":150,"min":0,"scale":0,"step":1,"type":"value","unit":"℃"},"schemaType":"value","type":"obj"},
  "136":{"code":"price_mode","id":"136","mode":"rw","name":"电费模式选择:","property":{"range":["single_rate","stair","peak_valley_stair"],"type":"enum"},"schemaType":"enum","type":"obj"},
  "137":{"code":"over_time","id":"137","mode":"rw","name":"超限电压恢复延时:","property":{"max":99,"min":0,"scale":0,"step":1,"type":"value","unit":"min"},"schemaType":"value","type":"obj"},
  "138":{"code":"ttl","id":"138","mode":"rw","name":"设备上电开关状态:","property":{"range":["open","colse","memory"],"type":"enum"},"schemaType":"enum","type":"obj"},
  "139":{"code":"prepayment_switch","id":"139","mode":"rw","name":"预付费开关","property":{"type":"bool"},"schemaType":"bool","type":"obj"},
  "140":{"code":"balance_energy","id":"140","mode":"ro","name":"剩余可用电量显示","property":{"max":500000,"min":0,"scale":2,"step":1,"type":"value","unit":"kW·h"},"schemaType":"value","type":"obj"},
  "141":{"code":"clear_energy","id":"141","mode":"rw","name":"剩余可用电量清零","property":{"type":"bool"},"schemaType":"bool","type":"obj"},
  "142":{"code":"energy_charge","id":"142","mode":"rw","name":"电量充值","property":{"max":500000,"min":0,"scale":2,"step":1,"type":"value","unit":"kW·h"},"schemaType":"value","type":"obj"},
  "143":{"code":"credit","id":"143","mode":"rw","name":"电量不足报警值","property":{"max":500,"min":10,"scale":0,"step":1,"type":"value","unit":"kW·h"},"schemaType":"value","type":"obj"}

Seems to match what would be expected from Query Things Data Model. There is also a different view of the schema in case something is missing from the above:

{"code":"switch_1","defaultValue":"false","canTrigger":true,"iconname":"icon-dp_power2","type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"开关状态","property":{"type":"bool"},"id":1,"editPermission":true},
{"code":"countdown_1","defaultValue":"0","canTrigger":false,"iconname":"icon-dp_time2","type":"obj","executable":false,"mode":"rw","defaultRecommend":false,"name":"开关倒计时","property":{"unit":"s","min":0,"max":360000,"scale":0,"step":1,"type":"value"},"id":9,"editPermission":true},
{"code":"add_ele","defaultValue":"0","canTrigger":false,"iconname":"icon-battery","trigger":"direct","type":"obj","executable":false,"mode":"rw","defaultRecommend":false,"name":"增加电量","property":{"unit":"kwh","min":0,"max":5000000,"scale":2,"step":1,"type":"value"},"id":17,"editPermission":true,"extContent":{"trigger":"direct"}},
{"code":"cur_current","defaultValue":"0","canTrigger":true,"iconname":"icon-Ele","type":"obj","executable":false,"mode":"ro","defaultRecommend":false,"name":"当前电流","property":{"unit":"A","min":0,"max":120000,"scale":3,"step":1,"type":"value"},"id":18,"editPermission":true},
{"code":"cur_power","defaultValue":"0","canTrigger":true,"iconname":"icon-dp_tool","type":"obj","executable":false,"mode":"ro","defaultRecommend":false,"name":"当前功率","property":{"unit":"W","min":0,"max":2800000,"scale":2,"step":1,"type":"value"},"id":19,"editPermission":true},
{"code":"cur_voltage","defaultValue":"0","canTrigger":true,"iconname":"icon-a_function_turbo","type":"obj","executable":false,"mode":"ro","defaultRecommend":false,"name":"当前电压","property":{"unit":"V","min":0,"max":30000,"scale":2,"step":1,"type":"value"},"id":20,"editPermission":true},
{"code":"price","defaultValue":"0","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"电费单价","property":{"unit":"","min":0,"max":99999,"scale":2,"step":1,"type":"value"},"id":101,"editPermission":false},
{"code":"cost","defaultValue":"0","canTrigger":true,"type":"obj","executable":true,"mode":"ro","defaultRecommend":false,"name":"总电费","property":{"unit":"","min":0,"max":50000000,"scale":3,"step":1,"type":"value"},"id":102,"editPermission":false,"extContent":{}},
{"code":"add_cost","defaultValue":"0","canTrigger":true,"trigger":"direct","type":"obj","executable":true,"mode":"ro","defaultRecommend":false,"name":"电费","property":{"unit":"","min":0,"max":5000000,"scale":2,"step":1,"type":"value"},"id":103,"editPermission":false,"extContent":{"trigger":"direct"}}, 
{"code":"ovp","defaultValue":"1","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"过压值","property":{"unit":"V","min":1,"max":2750,"scale":1,"step":1,"type":"value"},"id":104,"editPermission":false},
{"code":"ocp","defaultValue":"1","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"过流值","property":{"unit":"A","min":1,"max":1000,"scale":1,"step":1,"type":"value"},"id":105,"editPermission":false},
{"code":"opp","defaultValue":"1","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"过功率值","property":{"unit":"W","min":1,"max":27500,"scale":0,"step":1,"type":"value"},"id":106,"editPermission":false}, 
{"code":"language","defaultValue":"chinese","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"设备语言","property":{"range":["chinese","english"],"type":"enum"},"id":107,"editPermission":false},
{"code":"work_value","defaultValue":"1","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"工作屏幕亮度","property":{"unit":"","min":1,"max":9,"scale":0,"step":1,"type":"value"},"id":108,"editPermission":false},
{"code":"standby_value","defaultValue":"0","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"待机屏幕亮度","property":{"unit":"","min":0,"max":9,"scale":0,"step":1,"type":"value"},"id":109,"editPermission":false,"extContent":{}},
{"code":"standby_time","defaultValue":"3","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"进入待机时间","property":{"unit":"s","min":3,"max":99,"scale":0,"step":1,"type":"value"},"id":110,"editPermission":false},
{"code":"beep","defaultValue":"false","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"系统声音","property":{"type":"bool"},"id":111,"editPermission":false,"extContent":{}},
{"code":"sw_mode","defaultValue":"controlled","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"开关模式","property":{"range":["controlled","normally_open"],"type":"enum"},"id":112,"editPermission":false}, 
{"code":"data_reset","defaultValue":"false","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"累计数据清零","property":{"type":"bool"},"id":113,"editPermission":false},
{"code":"wifi_reset","defaultValue":"false","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"wifi设备重置","property":{"type":"bool"},"id":114,"editPermission":false},
{"code":"factor_reset","defaultValue":"false","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"恢复出厂设置","property":{"type":"bool"},"id":115,"editPermission":false}, 
{"code":"screen_rotation","defaultValue":"false","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"屏幕旋转","property":{"type":"bool"},"id":116,"editPermission":false,"extContent":{}}, 
{"code":"standby_screen","defaultValue":"original","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"待机画面","property":{"range":["original","measurement"],"type":"enum"},"id":117,"editPermission":false,"extContent":{}},
{"code":"menu","defaultValue":"safety_protection","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"设备显示风格:","property":{"range":["safety_protection","price_bill","big_data"],"type":"enum"},"id":118,"editPermission":false},
{"code":"lvp","defaultValue":"1","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"欠压值","property":{"unit":"V","min":1,"max":2650,"scale":1,"step":1,"type":"value"},"id":119,"editPermission":false},  {"code":"control","defaultValue":"false","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"超限控制使能","property":{"type":"bool"},"id":120,"editPermission":false},
{"code":"ele","defaultValue":"0","canTrigger":true,"type":"obj","executable":true,"mode":"ro","defaultRecommend":false,"name":"总电量","property":{"unit":"kwh","min":0,"max":999999999,"scale":3,"step":1,"type":"value"},"id":123,"editPermission":false},
{"code":"warning","defaultValue":"off","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"告警标志","property":{"range":["off","ovp","ocp","opp","lvp","le"],"type":"enum"},"id":132,"editPermission":false},
{"code":"cur_frequency","defaultValue":"0","canTrigger":true,"type":"obj","executable":true,"mode":"ro","defaultRecommend":false,"name":"当前频率","property":{"unit":"Hz","min":0,"max":100000,"scale":2,"step":1,"type":"value"},"id":133,"editPermission":false},
{"code":"power_factor","defaultValue":"0","canTrigger":true,"type":"obj","executable":true,"mode":"ro","defaultRecommend":false,"name":"功率因数","property":{"unit":"PF","min":0,"max":100,"scale":2,"step":1,"type":"value"},"id":134,"editPermission":false},
{"code":"cpu_temp","defaultValue":"0","canTrigger":true,"type":"obj","executable":true,"mode":"ro","defaultRecommend":false,"name":"仪表CPU温度","property":{"unit":"℃","min":0,"max":150,"scale":0,"step":1,"type":"value"},"id":135,"editPermission":false}, 
{"code":"price_mode","defaultValue":"single_rate","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"电费模式选择:","property":{"range":["single_rate","stair","peak_valley_stair"],"type":"enum"},"id":136,"editPermission":false},
{"code":"over_time","defaultValue":"0","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"超限电压恢复延时:","property":{"unit":"min","min":0,"max":99,"scale":0,"step":1,"type":"value"},"id":137,"editPermission":false},
{"code":"ttl","defaultValue":"open","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"设备上电开关状态:","property":{"range":["open","colse","memory"],"type":"enum"},"id":138,"editPermission":false,"extContent":{}},
{"code":"prepayment_switch","defaultValue":"false","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"预付费开关","property":{"type":"bool"},"id":139,"editPermission":false,"extContent":{}},
{"code":"balance_energy","defaultValue":"0","canTrigger":true,"type":"obj","executable":true,"mode":"ro","defaultRecommend":false,"name":"剩余可用电量显示","property":{"unit":"kW·h","min":0,"max":500000,"scale":2,"step":1,"type":"value"},"id":140,"editPermission":false,"extContent":{}},
{"code":"clear_energy","defaultValue":"false","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"剩余可用电量清零","property":{"type":"bool"},"id":141,"editPermission":false,"extContent":{}},  {"code":"energy_charge","defaultValue":"0","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"电量充值","property":{"unit":"kW·h","min":0,"max":500000,"scale":2,"step":1,"type":"value"},"id":142,"editPermission":false},
{"code":"credit","defaultValue":"10","canTrigger":true,"type":"obj","executable":true,"mode":"rw","defaultRecommend":false,"name":"电量不足报警值","property":{"unit":"kW·h","min":10,"max":500,"scale":0,"step":1,"type":"value"},"id":143,"editPermission":false}

@Adam-1974
Copy link
Author

I downloaded and organized the list from Smart Live.
This controller is more elaborate than the standard power meter models.
In my opinion, all IDs are its parameters and both lists are for the same entities.
The first is for setting/writing data to the power meter, and the second is for presenting the read data.
Here is a video to demonstrate its options: https://www.youtube.com/watch?v=8_BVQn13Qfc

Best Regards
Adam

@make-all make-all added the awaiting feedback Needs more information label Sep 11, 2023
@make-all
Copy link
Owner

Local logs are needed. Tuya devices have a limit of 255 bytes per message, and that dps list is 434 bytes in length, so clearly hasn't been captured from the local protocol.

@Adam-1974
Copy link
Author

I'm sorry but I don't quite understand what you're talking about to me.
This data is downloaded from the local Smart Live configuration file: preferences_global_keyeu1693133814447SJZn1.xml
The file is 45kB and there are no size restrictions there.
The extracted entities coincide with the settings in the device.
In my opinion, there are 39 parameters there and that's it.

Please explain to me what you need more and what I should do to get it.
I have been dealing with HA for 1 month and I am not strong in it. My IT knowledge was enough only to write a program that converts the above XML file to Json.

@make-all
Copy link
Owner

After you attempt to add the device to HA as a tuya-local device, go to Settings / System / Logs and look for messages from Tuya local. In one of them there should be a list of dps.

@Adam-1974
Copy link
Author

Hello again.
Sorry for such a long break. I have not had physical access to the device.

  1. I don't know why I can't connect the device to "TuyaLocal". I am sure I am entering the correct data in the wizard and yet I get the message:
    image
  2. I installed tinytuya and attach the files it downloaded. Maybe this will be enough for further work.

By the way, please give me a hint why I can't connect this device to Tuya Local.

@Adam-1974
Copy link
Author

I forgot to include the files. Here they are:
TinyTuya.zip

@blakadder
Copy link
Contributor

Potentially partially solved by #1139 , check if it works partially with that config since the manufacturer and display used are the same

@guffy1234
Copy link

guffy1234 commented Oct 23, 2023

it seems I build the config. It has almost all data points except a few related to data/factory reset and prepaid energy charge

name: Grid monitoring
products:
  - id: tjtigg991kvoiiqi
    name: ATorch AT4PBWP
primary_entity:
  entity: switch
  class: outlet
  dps:
    - id: 1
      type: boolean
      name: switch
secondary_entities:
  - entity: number
    category: config
    name: Countdown
    icon: "mdi:timer"
    dps:
      - id: 9
        type: integer
        name: value
        unit: min
        range:
          min: 0
          max: 360000
        mapping:
          - scale: 60
            step: 60
  - entity: sensor
    class: current
    name: Current
    dps:
      - id: 18
        name: sensor
        type: integer
        class: measurement
        unit: A
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    name: Power
    dps:
      - id: 19
        name: sensor
        type: integer
        class: measurement
        unit: W
        mapping:
          - scale: 100
  - entity: sensor
    class: voltage
    name: Voltage
    dps:
      - id: 20
        name: sensor
        type: integer
        class: measurement
        unit: V
        mapping:
          - scale: 100
  - entity: number
    category: config
    name: Price
    icon: "mdi:cash-multiple"
    dps:
      - id: 101
        type: integer
        name: value
        range:
          min: 0
          max: 99999
        mapping:
          - scale: 100
  - entity: sensor
    name: Cost
    icon: mdi:cash-clock
    dps:
      - id: 102
        name: sensor
        type: integer
        class: monetary
        precision: 2
        unit: UAH
        mapping:
          - scale: 1000
  - entity: number
    category: config
    name: Overvoltage value
    icon: "mdi:flash-triangle"
    dps:
      - id: 104
        type: integer
        name: value
        unit: V
        range:
          min: 1
          max: 2750
        mapping:
          - scale: 10
  - entity: number
    category: config
    name: Overcurrent value
    icon: "mdi:flash-triangle"
    dps:
      - id: 105
        type: integer
        name: value
        unit: A
        range:
          min: 1
          max: 1000
        mapping:
          - scale: 10
  - entity: number
    category: config
    name: Overpower value
    icon: "mdi:flash-triangle"
    dps:
      - id: 106
        type: integer
        name: value
        unit: W
        range:
          min: 1
          max: 27500
  - entity: select
    category: config
    icon: "mdi:web-box"
    name: Language
    dps:
      - id: 107
        type: string
        name: option
        mapping:
          - dps_val: chinese
            value: Chinese
          - dps_val: english
            value: English
  - entity: number
    category: config
    name: Screen brightness
    icon: "mdi:brightness-7"
    dps:
      - id: 108
        type: integer
        name: value
        range:
          min: 1
          max: 9
  - entity: number
    category: config
    name: Standby brightness
    icon: "mdi:brightness-4"
    dps:
      - id: 109
        type: integer
        name: value
        range:
          min: 1
          max: 9
  - entity: number
    category: config
    name: Standby time
    icon: "mdi:sun-clock"
    dps:
      - id: 110
        type: integer
        name: value
        unit: s
        range:
          min: 3
          max: 99
  - entity: switch
    name: Beep
    category: config
    dps:
      - id: 111
        type: boolean
        name: switch
  - entity: select
    name: Switch mode
    category: config
    dps:
      - id: 112
        type: string
        name: option
        mapping:
          - dps_val: controlled
            value: Controlled
          - dps_val: normally_open
            value: Normally Open
  - entity: select
    category: config
    name: Standby screen
    dps:
      - id: 117
        type: string
        name: option
        mapping:
          - dps_val: original
            value: Original
          - dps_val: measurement
            value: Measurement
  - entity: select
    category: config
    name: Display
    dps:
      - id: 118
        type: string
        name: option
        mapping:
          - dps_val: safety_protection
            value: Safety protection
          - dps_val: price_bill
            value: Electricity price setting and bill
          - dps_val: big_data
            value: Big data
  - entity: number
    category: config
    name: Undervoltage value
    icon: "mdi:flash-triangle"
    dps:
      - id: 119
        type: integer
        name: value
        unit: V
        range:
          min: 1
          max: 2750
        mapping:
          - scale: 10
  - entity: switch
    name: Overlimit control enable
    category: config
    dps:
      - id: 120
        type: boolean
        name: switch
  - entity: sensor
    name: Energy
    class: energy
    dps:
      - id: 123
        name: sensor
        type: integer
        class: total_increasing
        unit: kWh
        mapping:
          - scale: 1000
  - entity: sensor
    name: Warning
    class: enum
    category: diagnostic
    icon: "mdi:eye-circle-outline"
    dps:
      - id: 132
        name: sensor
        type: string
        mapping:
          - dps_val: "off"
            value: "Off"
          - dps_val: ovp
            value: Overvoltage protection
          - dps_val: ocp
            value: Overcurrent protection
          - dps_val: opp
            value: Overpower protection
          - dps_val: lvp
            value: Undervoltage protection
          - dps_val: le
            value: Low Energy
  - entity: sensor
    class: frequency
    name: Frequency
    dps:
      - id: 133
        name: sensor
        type: integer
        class: measurement
        unit: Hz
        mapping:
          - scale: 100
  - entity: sensor
    name: Power factor
    class: power_factor
    dps:
      - id: 134
        name: sensor
        type: integer
        class: measurement
        mapping:
          - scale: 100
  - entity: sensor
    name: CPU Temperature
    category: diagnostic
    class: temperature
    dps:
      - id: 135
        name: sensor
        type: integer
        class: measurement
        unit: C
  - entity: select
    category: config
    name: Energy tariff
    dps:
      - id: 136
        type: string
        name: option
        mapping:
          - dps_val: single_rate
            value: Single rate
          - dps_val: stair
            value: Stair
          - dps_val: peak_valley_stair
            value: Peak-valley
  - entity: number
    category: config
    name: Overvoltage recovery delay
    icon: "mdi:timer"
    dps:
      - id: 137
        type: integer
        name: value
        mode: box
        unit: min
        range:
          min: 0
          max: 99
  - entity: select
    category: config
    name: Poweron status
    dps:
      - id: 138
        type: string
        name: option
        mapping:
          - dps_val: open
            value: "On"
          - dps_val: colse
            value: "Off"
          - dps_val: memory
            value: Memory
  - entity: switch
    name: Prepaiment enable
    category: config
    dps:
      - id: 139
        type: boolean
        name: switch
  - entity: sensor
    name: Balance Energy
    class: energy
    category: diagnostic
    dps:
      - id: 140
        name: sensor
        type: integer
        unit: kWh
        mapping:
          - scale: 1000
  - entity: number
    category: config
    name: Low credit alarm
    icon: "mdi:alarm-bell"
    dps:
      - id: 143
        type: integer
        name: value
        mode: box
        unit: kWh
        range:
          min: 10
          max: 500

@guffy1234
Copy link

Screenshot_20231023_230440_Home Assistant

@MRZen13
Copy link

MRZen13 commented Nov 15, 2023

guffy1234, можете будь ласка мені допомогти з додаванням такого пристрою?
mrzen13@gmail.com

@make-all make-all added config provided Config included by reporter and removed awaiting feedback Needs more information labels Nov 15, 2023
@egore261282
Copy link

@guffy1234 help me add the necessary sensors for this device? I installed Local Tuya and added this device, but I can't add sensors

@unknown1818
Copy link

This is working with 1.0.9 firmware not with 1.1.1

@dr3amr
Copy link

dr3amr commented Aug 22, 2024

Just for anyone else looking for this information => I did not know how/where to add the new device config from @guffy1234 thus checking also #1139 issue was able to pinpoint the location to be ./config/custom_components/tuya_local/devices (edited in Studio Code Server). In this folder I created new file with contents of the config provided by @guffy1234 and named the file atorch_at4pw.yaml (to be easily recognizable), Then after making sure no other integration was connecting to the device, added it manually to Tuya Local adding the already known Device ID, IP and Local Key. Protocol version is 3.4. Post this you will have the "atorch_at4pw" config automatically selected in next screen for devices close to your device. All works fine on 1.0.9 version (I have 31 entities / device), have no notification for update to 1.1.1 in the Smart Life app for any of my 4 devices. Note (did not know this until recently) there is an option in the menu of the device (last option in the menu) to set how often the device is sending values, lowest value being 3s.

make-all added a commit that referenced this issue Sep 11, 2024
@make-all make-all added awaiting confirmation Wating for confirmation the issue is solved unreleased Will be in next release and removed config provided Config included by reporter labels Sep 11, 2024
@make-all make-all removed new device Unsupported device awaiting confirmation Wating for confirmation the issue is solved unreleased Will be in next release labels Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

8 participants