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

Lidl power Plug with monitoring #109

Closed
cob94440 opened this issue Jan 13, 2024 · 11 comments
Closed

Lidl power Plug with monitoring #109

cob94440 opened this issue Jan 13, 2024 · 11 comments
Labels
auto configure Related to auto configure entities feature.

Comments

@cob94440
Copy link

Hello I have my lidl power plug shown correctly. Except two things.
First power is seen as kwh instead of W
And second i miss the electric cumulative sensor as shown in pics below.
image
How can i help you helping me?

Environment

  • Localtuya version: 3.2.4
  • Home Assistant Core version: 2024.1.3
  • Home Assistant HAOS
  • [] Does the device work using the Home Assistant Tuya Cloud component ? Yes
  • [] Are you using the Tuya/SmartLife App in parallel ? yes
@cob94440 cob94440 added the bug Something isn't working label Jan 13, 2024
@xZetsubou
Copy link
Owner

xZetsubou commented Jan 13, 2024

Post your device diagnostic download it from HA device page.
As for the unit of measurement, you can re-configure your device from the entry configure button and select your device then to tweak your entities.

@cob94440
Copy link
Author

here you go :

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2024.1.3",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.11.6",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Paris",
    "os_name": "Linux",
    "os_version": "6.1.71-haos",
    "supervisor": "2023.12.0",
    "host_os": "Home Assistant OS 11.4",
    "docker_version": "24.0.7",
    "chassis": "vm",
    "run_as_root": true
  },
   "integration_manifest": {
    "domain": "localtuya",
    "name": "Local Tuya",
    "codeowners": [],
    "config_flow": true,
    "dependencies": [],
    "documentation": "https://github.com/xZetsubou/hass-localtuya/",
    "integration_type": "hub",
    "iot_class": "local_push",
    "issue_tracker": "https://github.com/xZetsubou/hass-localtuya/issues",
    "requirements": [],
    "version": "3.2.4",
    "is_built_in": false
  },
  "data": {
    "device_config": {
      "friendly_name": "Prise",
      "device_id": "bf9caaefb8d5c77244m8zw",
      "host": "10.0.0.141",
      "local_key": "",
      "protocol_version": "3.5",
      "enable_debug": false,
      "node_id": "a4c138d775a799db",
      "model": "Keetat-P2103-FR",
      "product_key": null,
      "gateway_id": "bf1f5a43fd80c529e7yoh1",
      "dps_strings": [
        "1 ( code: switch_1 , value: True )",
        "9 ( code: countdown_1 , value: 0 )",
        "17 ( code: add_ele , value: 80 )",
        "18 ( code: cur_current , value: 1071 )",
        "19 ( code: cur_power , value: 1160 )",
        "20 ( code: cur_voltage , value: 2290 )",
        "21 ( code: test_bit , value: 0, cloud pull )",
        "26 ( code: fault , value: 0, cloud pull )",
        "27 ( code: relay_status , value: off )",
        "28 ( code: light_mode , value: relay )"
      ],
      "entities": [
        {
          "id": "1",
          "friendly_name": "Switch 1",
          "icon": "",
          "entity_category": "None",
          "device_class": "outlet",
          "platform": "switch"
        },
        {
          "id": "9",
          "min_value": 0,
          "max_value": 86400,
          "step_size": 1,
          "scaling": 1,
          "unit_of_measurement": "s",
          "friendly_name": "Switch 1 Timer",
          "icon": "mdi:timer",
          "entity_category": "config",
          "platform": "number"
        },
        {
          "id": "18",
          "unit_of_measurement": "A",
          "friendly_name": "Current",
          "icon": "",
          "entity_category": "None",
          "device_class": "current",
          "state_class": "measurement",
          "platform": "sensor"
        },
        {
          "id": "19",
          "unit_of_measurement": "kW",
          "scaling": 0.1,
          "friendly_name": "Power",
          "icon": "",
          "entity_category": "None",
          "device_class": "power",
          "state_class": "measurement",
          "platform": "sensor"
        },
        {
          "id": "20",
          "unit_of_measurement": "V",
          "scaling": 0.1,
          "friendly_name": "Voltage",
          "icon": "",
          "entity_category": "None",
          "device_class": "voltage",
          "state_class": "measurement",
          "platform": "sensor"
        },
        {
          "id": "26",
          "state_on": "1",
          "friendly_name": "Fault",
          "icon": "",
          "entity_category": "diagnostic",
          "device_class": "problem",
          "platform": "binary_sensor"
        },
        {
          "id": "27",
          "select_options": {
            "on": "ON",
            "off": "OFF",
            "memory": "Last State"
          },
          "friendly_name": "Power-on behavior",
          "icon": "mdi:circle-double",
          "entity_category": "config",
          "platform": "select"
        },
        {
          "id": "28",
          "select_options": {
            "relay": "State",
            "pos": "Position",
            "none": "OFF"
          },
          "friendly_name": "Light Mode",
          "icon": "",
          "entity_category": "config",
          "platform": "select"
        }
      ]
    },
    "device_cloud_info": {
      "active_time": 1705090873,
      "biz_type": 0,
      "category": "cz",
      "create_time": 1705090873,
      "icon": "smart/icon/ay1559701439060fw6BY/14986ebea74ae21b1d98a188121e7e94.png",
      "id": "bf9caaefb8d5c77244m8zw",
      "ip": "",
      "lat": "48.1200",
      "local_key": "7[*b=@%V&<8g4U<M",
      "lon": "3.0400",
      "model": "Keetat-P2103-FR",
      "name": "Prise",
      "node_id": "a4c138d775a799db",
      "online": true,
      "owner_id": "42678109",
      "product_id": "ynmowqk2",
      "product_name": "Socket",
      "status": [
        {
          "code": "switch_1",
          "value": true
        },
        {
          "code": "countdown_1",
          "value": 0
        },
        {
          "code": "add_ele",
          "value": 260
        },
        {
          "code": "cur_current",
          "value": 1021
        },
        {
          "code": "cur_power",
          "value": 1140
        },
        {
          "code": "cur_voltage",
          "value": 2370
        },
        {
          "code": "relay_status",
          "value": "power_off"
        },
        {
          "code": "light_mode",
          "value": "relay"
        }
      ],
      "sub": true,
      "time_zone": "+01:00",
      "uid": "eu16376944487808FM9v",
      "update_time": 1705155157,
      "uuid": "a4c138d775a799db",
      "dps_data": {
        "1": {
          "code": "switch_1",
          "custom_name": "",
          "dp_id": 1,
          "time": 1705148186243,
          "value": true,
          "type": "Boolean",
          "values": "{\"type\": \"bool\", \"typeDefaultValue\": False}",
          "id": 1,
          "accessMode": "rw"
        },
        "9": {
          "code": "countdown_1",
          "custom_name": "",
          "dp_id": 9,
          "time": 1705097122137,
          "value": 0,
          "type": "Integer",
          "values": "{\"max\": 43200, \"min\": 0, \"scale\": 0, \"step\": 1, \"type\": \"value\", \"typeDefaultValue\": 0, \"unit\": \"s\"}",
          "id": 9,
          "accessMode": "rw"
        },
        "17": {
          "code": "add_ele",
          "custom_name": "",
          "dp_id": 17,
          "time": 1705153864162,
          "value": 160,
          "id": 17,
          "accessMode": "rw",
          "values": "{\"max\": 100000000, \"min\": 0, \"scale\": 3, \"step\": 100, \"type\": \"value\", \"typeDefaultValue\": 0, \"unit\": \"kwh\"}"
        },
        "18": {
          "code": "cur_current",
          "custom_name": "",
          "dp_id": 18,
          "time": 1705153725253,
          "value": 1021,
          "id": 18,
          "accessMode": "ro",
          "values": "{\"max\": 30000, \"min\": 0, \"scale\": 0, \"step\": 1, \"type\": \"value\", \"typeDefaultValue\": 0, \"unit\": \"mA\"}"
        },
        "19": {
          "code": "cur_power",
          "custom_name": "",
          "dp_id": 19,
          "time": 1705153725253,
          "value": 1120,
          "id": 19,
          "accessMode": "ro",
          "values": "{\"max\": 50000, \"min\": 0, \"scale\": 1, \"step\": 1, \"type\": \"value\", \"typeDefaultValue\": 0, \"unit\": \"W\"}"
        },
        "20": {
          "code": "cur_voltage",
          "custom_name": "",
          "dp_id": 20,
          "time": 1705153725253,
          "value": 2330,
          "id": 20,
          "accessMode": "ro",
          "values": "{\"max\": 5000, \"min\": 0, \"scale\": 1, \"step\": 1, \"type\": \"value\", \"typeDefaultValue\": 0, \"unit\": \"V\"}"
        },
        "21": {
          "code": "test_bit",
          "custom_name": "",
          "dp_id": 21,
          "time": 1705090873227,
          "value": 0,
          "id": 21,
          "accessMode": "ro",
          "values": "{\"max\": 5, \"min\": 0, \"scale\": 0, \"step\": 1, \"type\": \"value\", \"typeDefaultValue\": 0}"
        },
        "26": {
          "code": "fault",
          "custom_name": "",
          "dp_id": 26,
          "time": 1705090873227,
          "value": 0,
          "id": 26,
          "accessMode": "ro",
          "values": "{\"label\": [\"ov_cr\"], \"maxlen\": 1, \"type\": \"bitmap\", \"typeDefaultValue\": 0}"
        },
        "27": {
          "code": "relay_status",
          "custom_name": "",
          "dp_id": 27,
          "time": 1705097125015,
          "value": "off",
          "type": "Enum",
          "values": "{\"range\": [\"off\", \"on\", \"memory\"], \"type\": \"enum\", \"typeDefaultValue\": \"off\"}",
          "id": 27,
          "accessMode": "rw"
        },
        "28": {
          "code": "light_mode",
          "custom_name": "",
          "dp_id": 28,
          "time": 1705097125015,
          "value": "relay",
          "type": "Enum",
          "values": "{\"range\": [\"none\", \"relay\", \"pos\", \"on\"], \"type\": \"enum\", \"typeDefaultValue\": \"none\"}",
          "id": 28,
          "accessMode": "rw"
        }

@cob94440
Copy link
Author

I add device ID 17 and its ok. but it gives me 840 kwh instead of 0.84 now.
How can i tune it?
Also i can't find where to change 116 kwh to 116 w
If i edit the sensor it doesn't update W it stays kwh

Thanks for your help

@xZetsubou
Copy link
Owner

You can change the value that shows by modifying scaling factor the last option of sensor configuration if you want 840 shows as 0.84 then the scale factor should be 0.001, make sure the field unit of measurement 3rd option is "w".

image

xZetsubou added a commit that referenced this issue Jan 13, 2024
* Lights add scene data and colour data for "dd" category
@cob94440
Copy link
Author

Thanks. It' s almost ready.
what device class and state class do i have to put for my total kwh sensor?
I put energy and total encreasing but it doesn't show in ha energy

@xZetsubou
Copy link
Owner

kwh is energy class and state class is probably total increasing.

@cob94440
Copy link
Author

That's what i have but it doesn't show in energy dashoard

@xZetsubou
Copy link
Owner

That's weird maybe restarting HA may add it not 100% sure, at worst maybe removing the entity then re-add it with the correct inputs may fix it tho I hope just restart will fix it.

@cob94440
Copy link
Author

no luck i'll try to make a template for that.
thanks

@xZetsubou
Copy link
Owner

xZetsubou commented Jan 13, 2024

Btw I think unit of measurement is case sensitivity kWh tho I'm not sure if it will resolve it, I don't use HA energy monitor

I Added electricity sensor to auto configure. this isn't bug it just wasn't added to auto configure.

@xZetsubou xZetsubou added auto configure Related to auto configure entities feature. and removed bug Something isn't working labels Jan 14, 2024
@xZetsubou xZetsubou added the master/next-release Fixed in master branch, Will be ready in the next release label Jan 31, 2024
Copy link

github-actions bot commented Feb 3, 2024

This issue was closed because it was resolved on the release: 3.2.4.1

@github-actions github-actions bot added stale and removed master/next-release Fixed in master branch, Will be ready in the next release stale labels Feb 3, 2024
@github-actions github-actions bot closed this as completed Feb 3, 2024
xZetsubou added a commit that referenced this issue Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto configure Related to auto configure entities feature.
Projects
None yet
Development

No branches or pull requests

2 participants