tuya-home-assistant
tuya-home-assistant copied to clipboard
Support for WiFi Din Rail Switch with meterin, on/off works ok, but power mettering not logged
Product Name SP2-C Product Category cz https://es.aliexpress.com/item/1005004731986560.html?spm=a2g0o.order_detail.0.0.3b3439d3168us2&gatewayAdapt=glo2esp
Device info (please complete the following information, which can be found in log): like this: { "endpoint": "https://openapi.tuyaeu.com", "auth_type": 0, "country_code": "34", "app_type": "tuyaSmart", "mqtt_connected": true, "disabled_by": null, "disabled_polling": false, "name": "ICP Conectividad", "model": "AT-Q-SY1-JWT", "category": "dlq", "product_id": "jdj6ccklup7btq3a", "product_name": "WiFi Din Rail Switch with metering", "online": true, "sub": false, "time_zone": "+01:00", "active_time": "2022-11-29T20:27:28+00:00", "create_time": "2022-11-29T20:27:28+00:00", "update_time": "2022-12-01T08:45:20+00:00", "function": { "switch": { "type": "Boolean", "value": {} }, "countdown_1": { "type": "Integer", "value": { "unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1 } }, "relay_status": { "type": "Enum", "value": { "range": [ "power_off", "power_on", "last" ] } }, "light_mode": { "type": "Enum", "value": { "range": [ "relay", "pos", "none", "on" ] } } }, "status_range": { "switch": { "type": "Boolean", "value": {} }, "countdown_1": { "type": "Integer", "value": { "unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1 } }, "add_ele": { "type": "Integer", "value": { "min": 0, "max": 50000, "scale": 3, "step": 100 } }, "cur_current": { "type": "Integer", "value": { "unit": "mA", "min": 0, "max": 100000, "scale": 0, "step": 1 } }, "cur_power": { "type": "Integer", "value": { "unit": "W", "min": 0, "max": 99999, "scale": 1, "step": 1 } }, "cur_voltage": { "type": "Integer", "value": { "unit": "V", "min": 0, "max": 5000, "scale": 1, "step": 1 } }, "test_bit": { "type": "Integer", "value": { "min": 0, "max": 5, "scale": 0, "step": 1 } }, "voltage_coe": { "type": "Integer", "value": { "min": 0, "max": 1000000, "scale": 0, "step": 1 } }, "electric_coe": { "type": "Integer", "value": { "min": 0, "max": 1000000, "scale": 0, "step": 1 } }, "power_coe": { "type": "Integer", "value": { "min": 0, "max": 1000000, "scale": 0, "step": 1 } }, "electricity_coe": { "type": "Integer", "value": { "min": 0, "max": 1000000, "scale": 0, "step": 1 } }, "fault": { "type": "Bitmap", "value": { "label": [ "ov_cr", "ov_vol", "ov_pwr", "ls_cr", "ls_vol", "ls_pow" ] } }, "relay_status": { "type": "Enum", "value": { "range": [ "power_off", "power_on", "last" ] } }, "light_mode": { "type": "Enum", "value": { "range": [ "relay", "pos", "none", "on" ] } }, "child_lock": { "type": "Boolean", "value": {} } }, "status": { "switch": true, "countdown_1": 0, "add_ele": 44, "cur_current": 590, "cur_power": 873, "cur_voltage": 2310, "test_bit": 1, "voltage_coe": 0, "electric_coe": 0, "power_coe": 0, "electricity_coe": 0, "fault": 0, "relay_status": "last", "light_mode": "relay", "child_lock": false }, "home_assistant": { "name": "ICP Conectividad", "name_by_user": null, "disabled": false, "disabled_by": null, "entities": [ { "disabled": false, "disabled_by": null, "entity_category": "config", "device_class": null, "original_device_class": null, "icon": null, "original_icon": "mdi:account-lock", "unit_of_measurement": null, "state": { "entity_id": "switch.icp_conectividad_child_lock", "state": "off", "attributes": { "icon": "mdi:account-lock", "friendly_name": "ICP Conectividad Child Lock" }, "last_changed": "2022-12-01T18:42:06.397319+00:00", "last_updated": "2022-12-01T18:42:06.397319+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": null, "device_class": null, "original_device_class": null, "icon": null, "original_icon": null, "unit_of_measurement": null, "state": { "entity_id": "switch.icp_conectividad_switch", "state": "on", "attributes": { "friendly_name": "ICP Conectividad Switch" }, "last_changed": "2022-12-01T18:42:06.397884+00:00", "last_updated": "2022-12-01T18:42:06.397884+00:00" } } ] } }
Hello, this is my item. "WiFi Din Rail Switch with metering"
}, "data": { "endpoint": "https://openapi.tuyaeu.com", "auth_type": 0, "country_code": "33", "app_type": "smartlife", "mqtt_connected": true, "disabled_by": null, "disabled_polling": false, "name": "disj_plaque", "model": "AT-Q-SY1-JWT", "category": "dlq", "product_id": "jdj6ccklup7btq3a", "product_name": "WiFi Din Rail Switch with metering", "online": true, "sub": false, "time_zone": "+01:00", "active_time": "2022-12-08T10:10:06+00:00", "create_time": "2022-07-30T09:16:28+00:00", "update_time": "2022-12-08T12:15:24+00:00", "function": { "switch": { "type": "Boolean", "value": {} }, "countdown_1": { "type": "Integer", "value": { "unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1 } }, "relay_status": { "type": "Enum", "value": { "range": [ "power_off", "power_on", "last" ] } }, "light_mode": { "type": "Enum", "value": { "range": [ "relay", "pos", "none", "on" ] } } }, "status_range": { "switch": { "type": "Boolean", "value": {} }, "countdown_1": { "type": "Integer", "value": { "unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1 } }, "add_ele": { "type": "Integer", "value": { "min": 0, "max": 50000, "scale": 3, "step": 100 } }, "cur_current": { "type": "Integer", "value": { "unit": "mA", "min": 0, "max": 100000, "scale": 0, "step": 1 } }, "cur_power": { "type": "Integer", "value": { "unit": "W", "min": 0, "max": 99999, "scale": 1, "step": 1 } }, "cur_voltage": { "type": "Integer", "value": { "unit": "V", "min": 0, "max": 5000, "scale": 1, "step": 1 } }, "test_bit": { "type": "Integer", "value": { "min": 0, "max": 5, "scale": 0, "step": 1 } }, "voltage_coe": { "type": "Integer", "value": { "min": 0, "max": 1000000, "scale": 0, "step": 1 } }, "electric_coe": { "type": "Integer", "value": { "min": 0, "max": 1000000, "scale": 0, "step": 1 } }, "power_coe": { "type": "Integer", "value": { "min": 0, "max": 1000000, "scale": 0, "step": 1 } }, "electricity_coe": { "type": "Integer", "value": { "min": 0, "max": 1000000, "scale": 0, "step": 1 } }, "fault": { "type": "Bitmap", "value": { "label": [ "ov_cr", "ov_vol", "ov_pwr", "ls_cr", "ls_vol", "ls_pow" ] } }, "relay_status": { "type": "Enum", "value": { "range": [ "power_off", "power_on", "last" ] } }, "light_mode": { "type": "Enum", "value": { "range": [ "relay", "pos", "none", "on" ] } }, "child_lock": { "type": "Boolean", "value": {} } }, "status": { "switch": true, "countdown_1": 0, "add_ele": 1, "cur_current": 593, "cur_power": 20, "cur_voltage": 2391, "test_bit": 1, "voltage_coe": 0, "electric_coe": 0, "power_coe": 0, "electricity_coe": 0, "fault": 0, "relay_status": "last", "light_mode": "none", "child_lock": false }, "home_assistant": { "name": "disj_plaque", "name_by_user": null, "disabled": false, "disabled_by": null, "entities": [ { "disabled": false, "disabled_by": null, "entity_category": "config", "device_class": null, "original_device_class": null, "icon": null, "original_icon": "mdi:account-lock", "unit_of_measurement": null, "state": { "entity_id": "switch.disj_plaque_child_lock", "state": "off", "attributes": { "icon": "mdi:account-lock", "friendly_name": "disj_plaque Child Lock" }, "last_changed": "2022-12-08T12:32:51.906435+00:00", "last_updated": "2022-12-08T12:32:51.906435+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": null, "device_class": null, "original_device_class": null, "icon": null, "original_icon": null, "unit_of_measurement": null, "state": { "entity_id": "switch.disj_plaque_switch", "state": "on", "attributes": { "friendly_name": "disj_plaque Switch" }, "last_changed": "2022-12-08T12:32:51.907215+00:00", "last_updated": "2022-12-08T12:32:51.907215+00:00" } } ] } } }
the same here.(
Hi I have the same problem The power and voltage values are incorrect. It seems the data raw type isn't read correctly. Thanks for your help
See below my log "name": "Compteur g\u00e9n\u00e9ral ", "model": "IVAP", "category": "dlq", "product_id": "i55reuttymjocx0j", "product_name": "Smart meter IVAP ", "online": true, "sub": false, "time_zone": "+02:00", "active_time": "2022-10-16T07:14:46+00:00", "create_time": "2022-10-16T07:14:46+00:00", "update_time": "2022-12-30T15:47:58+00:00", "function": { "switch_prepayment": { "type": "Boolean", "value": {} }, "energy_reset": { "type": "Enum", "value": { "range": [ "empty" ] } }, "charge_energy": { "type": "Integer", "value": { "unit": "kW\u00b7h", "min": 0, "max": 999999, "scale": 0, "step": 1 } }, "switch": { "type": "Boolean", "value": {} }, "alarm_set_1": { "type": "Raw", "value": {} }, "alarm_set_2": { "type": "Raw", "value": {} } }, "status_range": { "total_forward_energy": { "type": "Integer", "value": { "unit": "kW\u00b7h", "min": 0, "max": 99999999, "scale": 2, "step": 1 } }, "phase_a": { "type": "Raw", "value": {} }, "phase_b": { "type": "Raw", "value": {} }, "phase_c": { "type": "Raw", "value": {} }, "fault": { "type": "Bitmap", "value": { "label": [ "short_circuit_alarm", "surge_alarm", "overload_alarm", "leakagecurr_alarm", "temp_dif_fault", "fire_alarm", "high_power_alarm", "self_test_alarm", "ov_cr", "unbalance_alarm", "ov_vol", "undervoltage_alarm", "miss_phase_alarm", "outage_alarm", "magnetism_alarm", "credit_alarm", "no_balance_alarm" ] } }, "switch_prepayment": { "type": "Boolean", "value": {} }, "energy_reset": { "type": "Enum", "value": { "range": [ "empty" ] } }, "balance_energy": { "type": "Integer", "value": { "unit": "kW\u00b7h", "min": -999999999, "max": 99999999, "scale": 2, "step": 1 } }, "charge_energy": { "type": "Integer", "value": { "unit": "kW\u00b7h", "min": 0, "max": 999999, "scale": 0, "step": 1 } }, "leakage_current": { "type": "Integer", "value": { "unit": "mA", "min": 0, "max": 1000000, "scale": 1, "step": 1 } }, "switch": { "type": "Boolean", "value": {} }, "alarm_set_1": { "type": "Raw", "value": {} }, "alarm_set_2": { "type": "Raw", "value": {} } }, "status": { "total_forward_energy": 126983, "phase_a": "AAABTgAAAFkDhgAGEQlV", "phase_b": "", "phase_c": "", "fault": 0, "switch_prepayment": false, "energy_reset": "", "balance_energy": 0, "charge_energy": 0, "leakage_current": 0, "switch": true, "alarm_set_1": "AAAAAAAAAAAAAABkAAEOAACqAAAAAAAKAAAAAAAA", "alarm_set_2": "AAUAZAAFAB4APAAAAAAAAAA=" }, "home_assistant": { "name": "Compteur g\u00e9n\u00e9ral ", "name_by_user": null, "disabled": false, "disabled_by": null, "entities": [ { "disabled": false, "disabled_by": null, "entity_category": null, "device_class": null, "original_device_class": "energy", "icon": null, "original_icon": null, "unit_of_measurement": "kWh", "state": { "entity_id": "sensor.compteur_general_total_energy", "state": "1269.83", "attributes": { "state_class": "total_increasing", "unit_of_measurement": "kWh", "device_class": "energy", "friendly_name": "Compteur g\u00e9n\u00e9ral Total energy" }, "last_changed": "2023-01-03T20:39:41.041631+00:00", "last_updated": "2023-01-03T20:39:41.041631+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": null, "device_class": null, "original_device_class": "current", "icon": null, "original_icon": null, "unit_of_measurement": "A", "state": { "entity_id": "sensor.compteur_general_phase_a_current", "state": "85.504", "attributes": { "state_class": "measurement", "unit_of_measurement": "A", "device_class": "current", "friendly_name": "Compteur g\u00e9n\u00e9ral Phase A current" }, "last_changed": "2023-01-03T20:40:38.059829+00:00", "last_updated": "2023-01-03T20:40:38.059829+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": null, "device_class": null, "original_device_class": "power", "icon": null, "original_icon": null, "unit_of_measurement": "kW", "state": { "entity_id": "sensor.compteur_general_phase_a_power", "state": "0.089", "attributes": { "state_class": "measurement", "unit_of_measurement": "kW", "device_class": "power", "friendly_name": "Compteur g\u00e9n\u00e9ral Phase A power" }, "last_changed": "2023-01-03T20:39:38.087471+00:00", "last_updated": "2023-01-03T20:39:38.087471+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": null, "device_class": null, "original_device_class": "voltage", "icon": null, "original_icon": null, "unit_of_measurement": "V", "state": { "entity_id": "sensor.compteur_general_phase_a_voltage", "state": "0.0", "attributes": { "state_class": "measurement", "unit_of_measurement": "V", "device_class": "voltage", "friendly_name": "Compteur g\u00e9n\u00e9ral Phase A voltage" }, "last_changed": "2023-01-03T15:20:37.639625+00:00", "last_updated": "2023-01-03T15:20:37.639625+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": null, "device_class": null, "original_device_class": "current", "icon": null, "original_icon": null, "unit_of_measurement": "A", "state": { "entity_id": "sensor.compteur_general_phase_b_current", "state": "unavailable", "attributes": { "restored": true, "state_class": "measurement", "device_class": "current", "friendly_name": "Phase B current", "supported_features": 0, "unit_of_measurement": "A" }, "last_changed": "2023-01-03T08:41:02.664585+00:00", "last_updated": "2023-01-03T08:41:02.664585+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": null, "device_class": null, "original_device_class": "power", "icon": null, "original_icon": null, "unit_of_measurement": "kW", "state": { "entity_id": "sensor.compteur_general_phase_b_power", "state": "unavailable", "attributes": { "restored": true, "state_class": "measurement", "device_class": "power", "friendly_name": "Phase B power", "supported_features": 0, "unit_of_measurement": "kW" }, "last_changed": "2023-01-03T08:41:02.664823+00:00", "last_updated": "2023-01-03T08:41:02.664823+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": null, "device_class": null, "original_device_class": "voltage", "icon": null, "original_icon": null, "unit_of_measurement": "V", "state": { "entity_id": "sensor.compteur_general_phase_b_voltage", "state": "unavailable", "attributes": { "restored": true, "state_class": "measurement", "device_class": "voltage", "friendly_name": "Phase B voltage", "supported_features": 0, "unit_of_measurement": "V" }, "last_changed": "2023-01-03T08:41:02.664951+00:00", "last_updated": "2023-01-03T08:41:02.664951+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": null, "device_class": null, "original_device_class": "current", "icon": null, "original_icon": null, "unit_of_measurement": "A", "state": { "entity_id": "sensor.compteur_general_phase_c_current", "state": "unavailable", "attributes": { "restored": true, "state_class": "measurement", "device_class": "current", "friendly_name": "Phase C current", "supported_features": 0, "unit_of_measurement": "A" }, "last_changed": "2023-01-03T08:41:02.665057+00:00", "last_updated": "2023-01-03T08:41:02.665057+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": null, "device_class": null, "original_device_class": "power", "icon": null, "original_icon": null, "unit_of_measurement": "kW", "state": { "entity_id": "sensor.compteur_general_phase_c_power", "state": "unavailable", "attributes": { "restored": true, "state_class": "measurement", "device_class": "power", "friendly_name": "Phase C power", "supported_features": 0, "unit_of_measurement": "kW" }, "last_changed": "2023-01-03T08:41:02.665155+00:00", "last_updated": "2023-01-03T08:41:02.665155+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": null, "device_class": null, "original_device_class": "voltage", "icon": null, "original_icon": null, "unit_of_measurement": "V", "state": { "entity_id": "sensor.compteur_general_phase_c_voltage", "state": "unavailable", "attributes": { "restored": true, "state_class": "measurement", "device_class": "voltage", "friendly_name": "Phase C voltage", "supported_features": 0, "unit_of_measurement": "V" }, "last_changed": "2023-01-03T08:41:02.665248+00:00", "last_updated": "2023-01-03T08:41:02.665248+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": null, "device_class": null, "original_device_class": null, "icon": null, "original_icon": null, "unit_of_measurement": null, "state": { "entity_id": "switch.compteur_general_switch", "state": "on", "attributes": { "friendly_name": "Compteur g\u00e9n\u00e9ral Switch" }, "last_changed": "2023-01-03T08:41:00.748655+00:00", "last_updated": "2023-01-03T08:41:00.748655+00:00" } } ] } },
Same here:
"data": {
"endpoint": "https://openapi.tuyaeu.com",
"auth_type": 0,
"country_code": "39",
"app_type": "smartlife",
"mqtt_connected": true,
"disabled_by": null,
"disabled_polling": false,
"name": "Differenziale climatizzatori",
"model": "AT-Q-SY1-JWT",
"category": "dlq",
"product_id": "jdj6ccklup7btq3a",
"product_name": "WiFi Din Rail Switch with metering",
"online": true,
"sub": false,
"time_zone": "+02:00",
"active_time": "2022-10-08T15:11:41+00:00",
"create_time": "2022-08-26T14:12:36+00:00",
"update_time": "2023-01-20T17:34:07+00:00",
"function": {
"switch": {
"type": "Boolean",
"value": {}
},
"countdown_1": {
"type": "Integer",
"value": {
"unit": "s",
"min": 0,
"max": 86400,
"scale": 0,
"step": 1
}
},
"relay_status": {
"type": "Enum",
"value": {
"range": [
"power_off",
"power_on",
"last"
]
}
},
"light_mode": {
"type": "Enum",
"value": {
"range": [
"relay",
"pos",
"none",
"on"
]
}
}
},
"status_range": {
"switch": {
"type": "Boolean",
"value": {}
},
"countdown_1": {
"type": "Integer",
"value": {
"unit": "s",
"min": 0,
"max": 86400,
"scale": 0,
"step": 1
}
},
"add_ele": {
"type": "Integer",
"value": {
"min": 0,
"max": 50000,
"scale": 3,
"step": 100
}
},
"cur_current": {
"type": "Integer",
"value": {
"unit": "mA",
"min": 0,
"max": 100000,
"scale": 0,
"step": 1
}
},
"cur_power": {
"type": "Integer",
"value": {
"unit": "W",
"min": 0,
"max": 99999,
"scale": 1,
"step": 1
}
},
"cur_voltage": {
"type": "Integer",
"value": {
"unit": "V",
"min": 0,
"max": 5000,
"scale": 1,
"step": 1
}
},
"test_bit": {
"type": "Integer",
"value": {
"min": 0,
"max": 5,
"scale": 0,
"step": 1
}
},
"voltage_coe": {
"type": "Integer",
"value": {
"min": 0,
"max": 1000000,
"scale": 0,
"step": 1
}
},
"electric_coe": {
"type": "Integer",
"value": {
"min": 0,
"max": 1000000,
"scale": 0,
"step": 1
}
},
"power_coe": {
"type": "Integer",
"value": {
"min": 0,
"max": 1000000,
"scale": 0,
"step": 1
}
},
"electricity_coe": {
"type": "Integer",
"value": {
"min": 0,
"max": 1000000,
"scale": 0,
"step": 1
}
},
"fault": {
"type": "Bitmap",
"value": {
"label": [
"ov_cr",
"ov_vol",
"ov_pwr",
"ls_cr",
"ls_vol",
"ls_pow"
]
}
},
"relay_status": {
"type": "Enum",
"value": {
"range": [
"power_off",
"power_on",
"last"
]
}
},
"light_mode": {
"type": "Enum",
"value": {
"range": [
"relay",
"pos",
"none",
"on"
]
}
},
"child_lock": {
"type": "Boolean",
"value": {}
}
},
"status": {
"switch": false,
"countdown_1": 0,
"add_ele": 2,
"cur_current": 18,
"cur_power": 33,
"cur_voltage": 2296,
"test_bit": 1,
"voltage_coe": 0,
"electric_coe": 0,
"power_coe": 0,
"electricity_coe": 0,
"fault": 0,
"relay_status": "last",
"light_mode": "relay",
"child_lock": false
},
"home_assistant": {
"name": "Differenziale",
"name_by_user": null,
"disabled": false,
"disabled_by": null,
"entities": [
{
"disabled": false,
"disabled_by": null,
"entity_category": "config",
"device_class": null,
"original_device_class": null,
"icon": null,
"original_icon": "mdi:account-lock",
"unit_of_measurement": null,
"state": {
"entity_id": "switch.differenziale",
"state": "off",
"attributes": {
"icon": "mdi:account-lock",
"friendly_name": "Differenziale"
},
"last_changed": "2023-01-21T20:48:22.428083+00:00",
"last_updated": "2023-01-21T20:48:22.428083+00:00"
}
},
{
"disabled": false,
"disabled_by": null,
"entity_category": null,
"device_class": null,
"original_device_class": null,
"icon": null,
"original_icon": null,
"unit_of_measurement": null,
"state": {
"entity_id": "switch.differenziale",
"state": "off",
"attributes": {
"friendly_name": "Differenziale"
},
"last_changed": "2023-01-21T20:48:22.428185+00:00",
"last_updated": "2023-01-21T20:48:22.428185+00:00"
}
}
]
}
}
}
@frenck @Tuya @zlinoliver Is there any way we can help to fix this?
Bump. :) A lot of stats available and options, they must be added in HM. :)
Any update?
Такая же проблема.