bieniu / ha-shellies-discovery-gen2

Script that adds MQTT discovery support for Shellies Gen2 devices
Apache License 2.0
100 stars 18 forks source link

Shelly PlusUni is not discovered #361

Closed Spartacus68 closed 7 months ago

Spartacus68 commented 7 months ago

Describe the bug

Expected behavior

The script is not shown in the sriot area of the web interface **Versions:** - Home Assistant: - Shellies Discovery GEN2: - Shelly device firmware: **Shellies Discovery GEN2 automation:**

Shelly device MQTT settings:

Debug log:

bieniu commented 7 months ago

Please show me response for Shelly.GetConfig and Shelly. GetStatus services.

Spartacus68 commented 7 months ago

Hi, thanks for reply, can you let me kow, how to run the services from HA?

Spartacus68 commented 7 months ago

Hi,

Shelly.GetConfig shows:

{
    "ble": {
        "enable": false,
        "rpc": {
            "enable": false
        },
        "observer": {
            "enable": false
        }
    },
    "cloud": {
        "enable": false,
        "server": "iot.shelly.cloud:6012/jrpc"
    },
    "humidity:100": {
        "id": 100,
        "name": null,
        "report_thr": 1,
        "offset": 0
    },
    "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": null,
        "type": "count",
        "enable": true,
        "count_rep_thr": 100,
        "freq_window": 1,
        "freq_rep_thr": 10,
        "xcounts": {
            "expr": null,
            "unit": null
        },
        "xfreq": {
            "expr": null,
            "unit": null
        }
    },
    "mqtt": {
        "enable": true,
        "server": "mosquitto.home.domain.de:8883",
        "client_id": "gh.klima",
        "user": "mqttService",
        "ssl_ca": "user_ca.pem",
        "topic_prefix": "gh.klima",
        "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,
        "auto_off": false,
        "auto_off_delay": 60
    },
    "switch:1": {
        "id": 1,
        "name": null,
        "in_mode": "follow",
        "initial_state": "match_input",
        "auto_on": false,
        "auto_on_delay": 60,
        "auto_off": false,
        "auto_off_delay": 60
    },
    "sys": {
        "device": {
            "name": "gh.klima",
            "mac": "A0A3B3DC8CE8",
            "fw_id": "20231219-133938/1.1.0-g34b5d4f",
            "discoverable": true,
            "eco_mode": false
        },
        "location": {
            "tz": "Europe/Berlin",
            "lat": 51.4416,
            "lon": 7.5633
        },
        "debug": {
            "level": 2,
            "file_level": null,
            "mqtt": {
                "enable": true
            },
            "websocket": {
                "enable": true
            },
            "udp": {
                "addr": null
            }
        },
        "ui_data": {},
        "rpc_udp": {
            "dst_addr": null,
            "listen_port": null
        },
        "sntp": {
            "server": "172.16.50.1"
        },
        "cfg_rev": 19
    },
    "temperature:100": {
        "id": 100,
        "name": null,
        "report_thr_C": 0.1,
        "offset_C": 0
    },
    "wifi": {
        "ap": {
            "ssid": "ShellyPlusUni-A0A3B3DC8CE8",
            "is_open": true,
            "enable": false,
            "range_extender": {
                "enable": false
            }
        },
        "sta": {
            "ssid": "50gHack",
            "is_open": false,
            "enable": true,
            "ipv4mode": "dhcp",
            "ip": null,
            "netmask": null,
            "gw": null,
            "nameserver": null
        },
        "sta1": {
            "ssid": null,
            "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"
    }
}

Shelly.GetStatus shows:

{
    "ble": {},
    "cloud": {
        "connected": false
    },
    "humidity:100": {
        "id": 100,
        "rh": 76.7
    },
    "input:0": {
        "id": 0,
        "state": false
    },
    "input:1": {
        "id": 1,
        "state": false
    },
    "input:2": {
        "id": 2,
        "counts": {
            "total": 0,
            "by_minute": [
                0,
                0,
                0
            ],
            "minute_ts": 1707721828
        },
        "freq": 0
    },
    "mqtt": {
        "connected": true
    },
    "switch:0": {
        "id": 0,
        "source": "WS_in",
        "output": false
    },
    "switch:1": {
        "id": 1,
        "source": "init",
        "output": false
    },
    "sys": {
        "mac": "A0A3B3DC8CE8",
        "restart_required": false,
        "time": "08:10",
        "unixtime": 1707721830,
        "uptime": 34215,
        "ram_size": 245388,
        "ram_free": 136572,
        "fs_size": 458752,
        "fs_free": 131072,
        "cfg_rev": 19,
        "kvs_rev": 0,
        "schedule_rev": 0,
        "webhook_rev": 0,
        "available_updates": {
            "beta": {
                "version": "1.2.0-beta1"
            }
        },
        "reset_reason": 3
    },
    "temperature:100": {
        "id": 100,
        "tC": 7.5,
        "tF": 45.5
    },
    "wifi": {
        "sta_ip": "172.16.50.120",
        "status": "got ip",
        "ssid": "50gHack",
        "rssi": -54
    },
    "ws": {
        "connected": false
    }
}
Spartacus68 commented 7 months ago

Hi,

the shelly is also visible in the MQTTExplorer Screenshot 2024-02-12 082957

Announce script: Screenshot 2024-02-12 084826

bieniu commented 7 months ago

How are the temperature:100 and humidity:100 sensors configured?

Spartacus68 commented 7 months ago

Hi bieniu,

what do you mean? The sensors have not been configured yet! I do not ave any experiance with sensors on a shelly devices. I hope that the values are reported to HA if the value changes! Do I need to configure something in the shelly? to work as expected by me?

bieniu commented 7 months ago

How is it physically configured? is this some external sensor connected to the device?

Spartacus68 commented 7 months ago

ah, ok! This is a 1wire DHT22 and it is connected as shown in the basic wiring diagram. https://kb.shelly.cloud/knowledge-base/shelly-plus-uni

I did it because I do not know about any "cheap" sensor-solution on the maket which can be easily connected wireless to the network for temperatures below -20°C. Maybe you have an better idea!

Spartacus68 commented 7 months ago

and btw. Is the support for the new uni being acknoledged via HA update later? Or how can the update be processed?

bieniu commented 7 months ago

You have to wait for the new version of Shellies Discovery.