arachnetech / homebridge-mqttthing

A plugin for Homebridge allowing the integration of many different accessory types using MQTT.
Apache License 2.0
462 stars 104 forks source link

Shelly Plus H&T topic data format #578

Open djsomi opened 1 year ago

djsomi commented 1 year ago

Hi All,

I just received, the new Shelly Plus H&T, and wanted to integrate to homekit, the device temperature topic is sending this data:

{"id": 0,"tC":29.1, "tF":84.4}

Dropping this to log: Ignoring invalid value [NaN] for Current Temperature - not a number

Which result 0 as value. Is there solution to grab only the tC value?

Many Thanks!

JustAnotherIssue commented 1 year ago
{
        "type": "temperatureSensor",
        "name": "Temperatur2 - Wohnraum",
        "url": "mqtt://xxxxxxxxxxxx:1883",
        "username": "xxxxxxxxxxx",
        "password": "xxxxxxxxxxx",
        "topics": {
            "getBatteryLevel": {
                "topic": "shellies/shellyplusht-xxxxxxxxxxxx/status/devicepower:0",
                "apply": "return JSON.parse(message)[\"battery\"].percent"
            },
            "getCurrentTemperature": {
                "topic": "shellies/shellyplusht-xxxxxxxxxxxxxxx/status/temperature:0",
                "apply": "return JSON.parse(message).tC"
            }
        },
        "onlineValue": "true",
        "offlineValue": "false",
        "accessory": "mqttthing"
    }

Hi, this config works best for me. Cheers

davidpraznik commented 1 year ago

@djsomi hi I just bought two Shelly Plus H&T and found out that the homebridge plugin still doesn't support the connection to homekit. If I understand correctly, can this problem be solved using mqtt and if so, is there a more precise solution on how to do it? Thank you big time, David

PS. @JustAnotherIssue can you help? Thank you! David

djsomi commented 1 year ago

Hi,

I Sold it, does not liked very much, but the previous comment maybe useful, I did not test it out.

BR

davidpraznik commented 1 year ago

Hi,

I Sold it, does not liked very much, but the previous comment maybe useful, I did not test it out.

BR

ok, thank you.

arachnetech commented 1 year ago

If you can get it to talk MQTT then mqttthing might be able to help... but I can't help with the first part unfortunately.

davidpraznik commented 1 year ago

thnx @arachnetech unfortunately, I don't have that knowledge either :(

JustAnotherIssue commented 1 year ago

Hey @davidpraznik see my post up there it is 1:1 the MQTT configuration of your HTplus Or did I misunderstand your problem?

davidpraznik commented 1 year ago

Hey @davidpraznik see my post up there it is 1:1 the MQTT configuration of your HTplus Or did I misunderstand your problem?

hej @JustAnotherIssue you understood correctly :) the problem is that I have zero knowledge about mqtt and I'm missing intermediate steps: where do I enter the above data, how do I set up mqtt, is the ip the ip of the raspberry pi and other "stupid" questions. I don't skip reading the instructions and I want to learn, but at the moment I'm missing intermediate steps. thanks for the response, appreciate it. david

JustAnotherIssue commented 1 year ago

Got it @davidpraznik you are really starting from scratch. But you have a great journey ahead. Mqtt helped me a lot in terms of smart home. Also in understanding things and topics around.

To start and gain all the knowledge needed I recommend to Learn about homebridge mqtt broker (e.g. mosquito) Homebridge plugin mqttthing This will be your basis.

But your main tool in terms of understanding will be MQTT explorer. It will help you to see mqtt messages/topics

Enable mqtt on your HT plus and send the info to the broker. Connect with the exlorer to the broker and see messages. Then you will start to understand my initial post. tutorials helped me a lot. There are plenty on youtube.

if you are there then you will be able to enter the configuration lines into mqttthing and bring it to homebridge

it works well there. And superfast. have fun

davidpraznik commented 1 year ago

@JustAnotherIssue thanks for the guide. i'll start reading :) oh and thank you for your kindness and help. david

cmanblues commented 1 year ago

I cant get my Shelly H&T Plus to show up as a device in Homebridge. The H&T Plus is configured for MQTT and it shows that its connected via MQTT. MQTT Broker and MQTTTHING Plug-Ins are installed in Homebridge. @JustAnotherIssue First, I tried to configure the device in Homebridge directly in the MQTTTHING Plug-In, which did not work, then I used your config and adapted it to my device-ID and MQTT server & port.

Any ideas what I could have missed?

JustAnotherIssue commented 1 year ago

@cmanblues devil can be in the details but without having any insights to your configuration everything is just guessing but not supporting. Could you share screenshots or json configs.

Btw. The best troubleshooting and debugging tool is the mqtt explorer