homebridge-mqttthing icon indicating copy to clipboard operation
homebridge-mqttthing copied to clipboard

Shelly Plus H&T topic data format

Open djsomi opened this issue 1 year ago • 12 comments

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!

djsomi avatar Aug 04 '22 11:08 djsomi

{
        "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

JustAnotherIssue avatar Sep 21 '22 19:09 JustAnotherIssue

@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

davidpraznik avatar Dec 24 '22 13:12 davidpraznik

Hi,

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

BR

djsomi avatar Dec 24 '22 13:12 djsomi

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.

davidpraznik avatar Dec 24 '22 13:12 davidpraznik

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.

arachnetech avatar Dec 24 '22 13:12 arachnetech

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

davidpraznik avatar Dec 24 '22 13:12 davidpraznik

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

JustAnotherIssue avatar Dec 25 '22 09:12 JustAnotherIssue

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

davidpraznik avatar Dec 25 '22 09:12 davidpraznik

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

JustAnotherIssue avatar Dec 25 '22 11:12 JustAnotherIssue

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

davidpraznik avatar Dec 25 '22 12:12 davidpraznik

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?

cmanblues avatar Jan 05 '23 22:01 cmanblues

@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

JustAnotherIssue avatar Jan 10 '23 20:01 JustAnotherIssue