Introducing the Shims plugin

Posted on
Wed May 06, 2020 2:25 pm
FlyingDiver offline
User avatar
Posts: 4261
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Introducing the Shims plugin

First, you need to confirm that the MQTT Connector is subscribed to the update topics properly. It's not the same as the command topics.

Then you need to make sure there's a trigger on the Connector to queue those messages to the Shims plugin.

Then you need to look at the Shim device configuration. I can't find my notes on what the MQTT topics and payloads look like, so you're going to need to post what you're actually getting before I can tell if you have it set up properly.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed May 06, 2020 3:45 pm
shapa offline
Posts: 392
Joined: Sep 08, 2014
Location: Swindon

Re: Introducing the Shims plugin

Found the problem, works now.

The topic should be "stat/#" for the Sonoff.

Posted on
Wed May 06, 2020 3:47 pm
FlyingDiver offline
User avatar
Posts: 4261
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Introducing the Shims plugin

For the topic "stat/tasmota/POWER ON", you need to subscribe to "stat/#". Without the wildcard (#) it's never going to match.

Oh, and you generally don't want to subscribe to anything that starts with "indigo/", since those are messages you're sending (not receiving).

That'll probably fix it.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed May 06, 2020 4:11 pm
shapa offline
Posts: 392
Joined: Sep 08, 2014
Location: Swindon

Re: Introducing the Shims plugin

Now I'm curious

Is it possible to take the "Load" (as I could understand - wattage?) from the telemetrics?

What should I specify (if supported) as a "Power Payload Key"? "LoadAvg"? What is the syntax?

Code: Select all
   MQTT Connector Debug            MQTT Connector: Saved states, topic: tele/tasmota_B39E94/STATE, payload: {"Time":"2020-05-06T23:06:04","Uptime":"0T03:25:12","UptimeSec":12312,"Heap":26,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER":"ON","Wifi":{"AP":1,"SSId":"Shapa 2Ghz","BSSId":"4E:D9:E7:FD:B4:B6","Channel":6,"RSSI":100,"Signal":-33,"LinkCount":1,"Downtime":"0T00:00:06"}}

Posted on
Wed May 06, 2020 4:13 pm
FlyingDiver offline
User avatar
Posts: 4261
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Introducing the Shims plugin


joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Fri May 22, 2020 11:27 am
neilk offline
Posts: 338
Joined: Jul 13, 2015
Location: Reading, UK

Re: Introducing the Shims plugin

Hi,

I have managed to setup the MQTT plugin, and I am getting the following payload

Code: Select all
{"elecMtr":{"0702":{"03":{"01":"00000001","04":"00","02":"000003E8","07":"2000051976213","03":"FB","08":"","00":"00","06":"00"},"00":{"07":"00000000","01":"000000000001","00":"0000004D8DF1","14":"02","02":"000000000000"},"04":{"01":"0054DB","40":"0A5B1E","30":"0242C5","00":"00000471"},"02":{"00":"00"}},"0708":{"01":{"01":"E.ON"}}},"gasMtr":{"0702":{"03":{"01":"00000001","12":"00","02":"000003E8","07":"8928098507","03":"2B","08":"","00":"01","06":"80"},"00":{"00":"0000000EC6B6","14":"02"},"0C":{"01":"005B19","40":"0E665F","30":"01D487"},"02":{"00":"00"}},"0708":{"01":{"01":""}}},"ts":"2020-05-22 16:00:16","hversion":"GLOW-IHD-01-1v4-SMETS2","time":"5EC7F710","zbSoftVer":"1.2.5","gmtime":1590163216,"pan":{"rssi":"AD","status":"joined","nPAN":"00","join":"0","lqi":"44"},"smetsVer":"SMETS2","ets":"2000-01-01 00:00:00","gid":"70B3D521E0008C05"}


And I have the Shims setup to match the appropriate message and get this error

Code: Select all
MQTT Shims Error                Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 107, in runConcurrentThread
  File "plugin.py", line 132, in processMessages
  File "plugin.py", line 589, in update
StandardError: LowLevelBadParameterError -- illegal XML tag name character

   MQTT Shims Error                plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)


Which is reasonably self explanatory but I cannot spot anything obvious, the following device states get created

Screenshot 2020-05-22 at 18.19.58.png
Screenshot 2020-05-22 at 18.19.58.png (14.65 KiB) Viewed 149 times


It could well be my understanding of the multi states key option.

Thanks
Neil

Posted on
Fri May 22, 2020 11:39 am
FlyingDiver offline
User avatar
Posts: 4261
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Introducing the Shims plugin

There are two things going on here - first is that Indigo really hates dict keys that start with a number (digits 0-9). And I obviously forgot to account for that in this plugin. I'll have to fix that.

Second, what part of that payload do you actually want to use for state?

If it's the "outer" dictionary, and you put "." in that config field, then it's working right. Except for the error which is causing the states to be empty.

I added formatting to the payload to make it easier to see what's in there:
Code: Select all
{
    "elecMtr":
    {
        "0702":
        {
            "03":
            {
                "01":"00000001",
                "04":"00",
                "02":"000003E8",
                "07":"2000051976213",
                "03":"FB",
                "08":"",
                "00":"00",
                "06":"00"
            },
            "00":
            {
                "07":"00000000",
                "01":"000000000001",
                "00":"0000004D8DF1",
                "14":"02",
                "02":"000000000000"
            },
            "04":
            {
                "01":"0054DB",
                "40":"0A5B1E",
                "30":"0242C5",
                "00":"00000471"
            },
            "02":
            {
                "00":"00"
            }
        },
        "0708":
        {
            "01":
            {
                "01":"E.ON"
            }
        }
    },
    "gasMtr":
    {
        "0702":
        {
            "03":
            {
                "01":"00000001",
                "12":"00",
                "02":"000003E8",
                "07":"8928098507",
                "03":"2B",
                "08":"",
                "00":"01",
                "06":"80"
            },
            "00":
            {
                "00":"0000000EC6B6",
                "14":"02"
            },
            "0C":
            {
                "01":"005B19",
                "40":"0E665F",
                "30":"01D487"
            },
            "02":
            {
                "00":"00"
            }
        },
        "0708":
        {
            "01":
            {
                "01":""
            }
        }
    },
    "ts":"2020-05-22 16:00:16",
    "hversion":"GLOW-IHD-01-1v4-SMETS2",
    "time":"5EC7F710",
    "zbSoftVer":"1.2.5",
    "gmtime":1590163216,
    "pan":
    {
        "rssi":"AD",
        "status":"joined",
        "nPAN":"00",
        "join":"0",
        "lqi":"44"
    },
    "smetsVer":"SMETS2",
    "ets":"2000-01-01 00:00:00",
    "gid":"70B3D521E0008C05"
}

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Fri May 22, 2020 12:03 pm
neilk offline
Posts: 338
Joined: Jul 13, 2015
Location: Reading, UK

Re: Introducing the Shims plugin

FlyingDiver wrote:
Second, what part of that payload do you actually want to use for state?

If it's the "outer" dictionary, and you put "." in that config field, then it's working right. Except for the error which is causing the states to be empty.



Joe - thanks, I thought that may be the case for the outer dictionary (aside from the error). This is a JSON encoded version of the SEP (zigbee Smart Energy Profile specification) which is used for Smart Gas and Electricity Meters. I am digging through the 600 page spec right now, but I do know the actual consumption is in the nested sections so ultimately I will need at least some of those as well.

Neil

Posted on
Fri May 22, 2020 4:53 pm
neilk offline
Posts: 338
Joined: Jul 13, 2015
Location: Reading, UK

Re: Introducing the Shims plugin

Joe,
Just an FYI so I don't lead you down the garden path, I think it makes more sense for me to consume the payload direct from the MQTT plugin queue and I don't really need the Shims plugin, so don't burn too much effort on that (unless other payloads may have similar issues). Sorry to mess you around as I was trying to get my head around MQTT, Shims etc. This is amazing stuff though, it makes the bit I need to do incredibly simple so thank you. I will try and create comprehensive documentation when I am done.
Thanks,
Neil

Who is online

Users browsing this forum: No registered users and 0 guests