home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.28k stars 30.6k forks source link

Integration for new Shelly PlusUni - Pulse Counter / Pulse Counting #110189

Closed KyleKat closed 8 months ago

KyleKat commented 8 months ago

Shelly PlusUni - Pulse Counter / Pulse Counting

Hi,

there is a new Shelly Device available: https://www.shelly.com/en-de/products/product-overview/shelly-plus-uni-1

This device has an integrated pulse counter which can for example be used as an pulse counter for gas meter integration in HA.

The counter is described as Detached input in the web interface of the shelly.

Shelly_PlusUni_Pulse

It would be great to see an update to the shelly intergration to add this counter as an sensor.

What version of Home Assistant Core has the issue?

2024.2.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Shelly Integration

Link to integration documentation on our website

https://www.home-assistant.io/integrations/shelly

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 8 months ago

Hey there @balloob, @bieniu, @thecode, @chemelli74, @bdraco, mind taking a look at this issue as it has been labeled with an integration (shelly) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `shelly` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign shelly` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


shelly documentation shelly source (message by IssueLinks)

bieniu commented 8 months ago

Please show us a response for Shelly.GetConfig service (curl http://<SHELLY_IP_ADDRESS>/rpc/Shelly.GetConfig).

KyleKat commented 8 months ago

Here is the result:

{
    "ble": {
        "enable": false,
        "rpc": {
            "enable": false
        },
        "observer": {
            "enable": false
        }
    },
    "cloud": {
        "enable": false,
        "server": "iot.shelly.cloud:6012/jrpc"
    },
    "input:0": {
        "id": 0,
        "name": null,
        "type": "switch",
        "enable": true,
        "invert": false
    },
    "input:1": {
        "id": 1,
        "name": null,
        "type": "switch",
        "enable": true,
        "invert": false
    },
    "input:2": {
        "id": 2,
        "name": "Gascounter",
        "type": "count",
        "enable": true,
        "count_rep_thr": 1,
        "freq_window": 1,
        "freq_rep_thr": 10,
        "xcounts": {
            "expr": "x*0.01",
            "unit": "m³"
        },
        "xfreq": {
            "expr": null,
            "unit": null
        }
    },
    "mqtt": {
        "enable": true,
        "server": "",
        "client_id": "shellyplusuni-xxxxxxxx",
        "user": null,
        "ssl_ca": null,
        "topic_prefix": "shellyplusuni-xxxxxxxx",
        "rpc_ntf": true,
        "status_ntf": true,
        "use_client_cert": false,
        "enable_rpc": true,
        "enable_control": true
    },
    "switch:0": {
        "id": 0,
        "name": null,
        "in_mode": "follow",
        "initial_state": "match_input",
        "auto_on": false,
        "auto_on_delay": 60.0,
        "auto_off": false,
        "auto_off_delay": 60.0
    },
    "switch:1": {
        "id": 1,
        "name": null,
        "in_mode": "follow",
        "initial_state": "match_input",
        "auto_on": false,
        "auto_on_delay": 60.0,
        "auto_off": false,
        "auto_off_delay": 60.0
    },
    "sys": {
        "device": {
            "name": null,
            "mac": "",
            "fw_id": "20231219-133938/1.1.0-g34b5d4f",
            "discoverable": true,
            "eco_mode": false
        },
        "location": {
            "tz": "Europe/Berlin",
            "lat":
            "lon":
        },
        "debug": {
            "level": 2,
            "file_level": null,
            "mqtt": {
                "enable": false
            },
            "websocket": {
                "enable": false
            },
            "udp": {
                "addr": null
            }
        },
        "ui_data": {},
        "rpc_udp": {
            "dst_addr": null,
            "listen_port": null
        },
        "sntp": {
            "server": "time.google.com"
        },
        "cfg_rev": 19
    },
    "wifi": {
        "ap": {
            "ssid": "ShellyPlusUni-XXXXXXXX",
            "is_open": true,
            "enable": true,
            "range_extender": {
                "enable": false
            }
        },
        "sta": {
            "ssid": "",
            "is_open": false,
            "enable": true,
            "ipv4mode": "dhcp",
            "ip": null,
            "netmask": null,
            "gw": null,
            "nameserver": null
        },
        "sta1": {
            "ssid": "ShellyPlus1-XXXXXXXX",
            "is_open": true,
            "enable": false,
            "ipv4mode": "dhcp",
            "ip": null,
            "netmask": null,
            "gw": null,
            "nameserver": null
        },
        "roam": {
            "rssi_thr": -80,
            "interval": 60
        }
    },
    "ws": {
        "enable": false,
        "server": null,
        "ssl_ca": "ca.pem"
    }
}
bieniu commented 8 months ago

Please also share a response to Shelly.GetStatus service.

KyleKat commented 8 months ago

This is the output:

{
    "ble": {
    },
    "cloud": {
        "connected": false
    },
    "input:0": {
        "id": 0,
        "state": false
    },
    "input:1": {
        "id": 1,
        "state": false
    },
    "input:2": {
        "counts": {
            "by_minute": [
                2,
                3,
                4
            ],
            "minute_ts": 1707608611,
            "total": 56174,
            "xby_minute": [
                0.02,
                0.03,
                0.04
            ],
            "xtotal": 561.74
        },
        "freq": 0.0,
        "id": 2
    },
    "mqtt": {
        "connected": true
    },
    "switch:0": {
        "id": 0,
        "output": false,
        "source": "init"
    },
    "switch:1": {
        "id": 1,
        "output": false,
        "source": "init"
    },
    "sys": {
        "available_updates": {
            "beta": {
                "version": "1.2.0-beta1"
            }
        },
        "cfg_rev": 19,
        "fs_free": 143360,
        "fs_size": 458752,
        "kvs_rev": 0,
        "mac": "",
        "ram_free": 128916,
        "ram_size": 245368,
        "reset_reason": 3,
        "restart_required": false,
        "schedule_rev": 0,
        "time": "00:43",
        "unixtime": 1707608613,
        "uptime": 26094,
        "webhook_rev": 0
    },
    "wifi": {
        "rssi": -71,
        "ssid": "",
        "sta_ip": "",
        "status": "got ip"
    },
    "ws": {
        "connected": false
    }
}
KyleKat commented 8 months ago

Please also share a response to Shelly.GetStatus service.

Thanks so much for looking into that!!