Using Shelly devices with the MQTT plugin

Posted on
Sat Feb 15, 2020 1:42 pm
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Using Shelly devices with the MQTT plugin

The HTTP API and the MQTT API are very different, and data from one doesn't help with the other. The HTTP one is useful for changing the device settings, which you can't do with MQTT.

So the only outstanding issue is that you can't set the device brightness, correct? That's going to take some work, because it doesn't use the same topic/payload as turning it on/off.

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

Posted on
Sat Feb 15, 2020 2:04 pm
CliveS offline
Posts: 770
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: Using Shelly devices with the MQTT plugin

FlyingDiver wrote:
The HTTP API and the MQTT API are very different, and data from one doesn't help with the other. The HTTP one is useful for changing the device settings, which you can't do with MQTT.

So the only outstanding issue is that you can't set the device brightness, correct? That's going to take some work, because it doesn't use the same topic/payload as turning it on/off.


Yes, that is the only issue.

CliveS

Indigo 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB SSD
----------------------------------------------------------------------------------
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer

Posted on
Sun Feb 16, 2020 4:50 pm
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Using Shelly devices with the MQTT plugin

CliveS wrote:
FlyingDiver wrote:
The HTTP API and the MQTT API are very different, and data from one doesn't help with the other. The HTTP one is useful for changing the device settings, which you can't do with MQTT.

So the only outstanding issue is that you can't set the device brightness, correct? That's going to take some work, because it doesn't use the same topic/payload as turning it on/off.


Yes, that is the only issue.


Pre-release here to address this issue: https://github.com/FlyingDiver/Indigo-S ... /tag/0.2.1

Edit the Dimmer device. The action section has been expanded, and for a Shelly Dimmer, I think it should look like this. Not tested, since I don't have a Shelly Dimmer.
Attachments
Screen Shot 2020-02-16 at 5.46.35 PM.png
Screen Shot 2020-02-16 at 5.46.35 PM.png (108.05 KiB) Viewed 3122 times

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

Posted on
Mon Feb 17, 2020 10:00 am
CliveS offline
Posts: 770
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: Using Shelly devices with the MQTT plugin

I have installed 0.2.1 but I still cannot get the dimmer to work, possibly due to not knowing what to put in the Payload Key and Value Key.

CliveS

Indigo 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB SSD
----------------------------------------------------------------------------------
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer

Posted on
Mon Feb 17, 2020 12:10 pm
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Using Shelly devices with the MQTT plugin

CliveS wrote:
I have installed 0.2.1 but I still cannot get the dimmer to work, possibly due to not knowing what to put in the Payload Key and Value Key.


You can’t command it? But status updates work?

The templates I posted above should work to command it. Post what you currently have.


Sent from my iPhone using Tapatalk

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

Posted on
Mon Feb 17, 2020 12:38 pm
CliveS offline
Posts: 770
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: Using Shelly devices with the MQTT plugin

When I use the IOS app to change the dimmer value it changes in all the right places. When I change the slider on the UI I then get the Set = line appear at what ever i click, I know it does not work but just trying to give an idea of what happens.

Dimmer.jpg
Dimmer.jpg (73.28 KiB) Viewed 3069 times

CliveS

Indigo 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB SSD
----------------------------------------------------------------------------------
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer

Posted on
Mon Feb 17, 2020 3:56 pm
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Using Shelly devices with the MQTT plugin

CliveS wrote:
When I change the slider on the UI I then get the Set = line appear at what ever i click, I know it does not work but just trying to give an idea of what happens.


Not sure I understand this sentence. That "set" topic only appears when you use the Indigo UI control to set the brightness level, correct? According to the Shelly docs, that topic/payload should work:

https://shelly-api-docs.shelly.cloud/#s ... er-sl-mqtt

Without hardware to test with, I'm not sure I can do anything else here.

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

Posted on
Mon Feb 17, 2020 4:46 pm
CliveS offline
Posts: 770
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: Using Shelly devices with the MQTT plugin

Using the Indigo UI pressing on and off works, the slider does not change the brightness.
It does update the set = line in the MQTT Explorer window.

CliveS

Indigo 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB SSD
----------------------------------------------------------------------------------
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer

Posted on
Mon Feb 17, 2020 4:48 pm
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Using Shelly devices with the MQTT plugin

Just for grins, change the "Dimmer Action Payload" template to use double-quotes instead of single quotes.

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

Posted on
Sat Nov 28, 2020 1:33 pm
roquej offline
User avatar
Posts: 609
Joined: Jan 04, 2015
Location: South Florida, USA

Re: Using Shelly devices with the MQTT plugin

I am having a bit of a problem getting a ShellyGas device working with the MQTT Shims plugin.

The trigger definition, I believe, is correct, for all topics for the ShellyGas device. However, I am struggling with how to define the Shims device, as this is not a standard device.

Could anyone point me in the right direction?

Thank you!

JP
Attachments
device definition.jpg
Device definition, which I think is my problem as this is not a standard device
device definition.jpg (102.39 KiB) Viewed 2556 times
trigger definition.jpg
Trigger Definition for all topics for ShellyGas
trigger definition.jpg (87.48 KiB) Viewed 2556 times
explorer.jpg
ShellyGas MQTT Explorer info
explorer.jpg (79.74 KiB) Viewed 2556 times

Posted on
Sat Nov 28, 2020 1:56 pm
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Using Shelly devices with the MQTT plugin

First question - does Aaron already have this one in his plugin? If so, use it. ;)

Second question - what are you actually trying to make the device do? Just show the concentration as sensor value? Be an on/off (alarm) sensor "gas" != "none"?

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

Posted on
Sat Nov 28, 2020 1:58 pm
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Using Shelly devices with the MQTT plugin

Also, your "Unique ID" is always the string with the device serial number in it, which is the "shellygas-1052..." string.

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

Posted on
Sat Nov 28, 2020 2:34 pm
roquej offline
User avatar
Posts: 609
Joined: Jan 04, 2015
Location: South Florida, USA

Re: Using Shelly devices with the MQTT plugin

** Sorry, if I responded multiple times. My browse acted up when responding.

Sadly, it does not yet.

I am trying to determine when field "gas" (#1 in structure) is != "none", which should mean the status of "on" (none should then be "off").

Makes sense?

Posted on
Sat Nov 28, 2020 3:33 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: Using Shelly devices with the MQTT plugin

I have the gas sensor working w the Shelly-direct

The sensor only triggers- sounds alarm with a relative high gas concentration= The smell is so strong you will want to leave the room
I had to leave the gas burner in for 3 minutes and have the Shelly device next to it. Only the it triggered


Sent from my iPhone using Tapatalk

Posted on
Sat Nov 28, 2020 3:45 pm
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Using Shelly devices with the MQTT plugin

roquej wrote:
** Sorry, if I responded multiple times. My browse acted up when responding.

Sadly, it does not yet.

I am trying to determine when field "gas" (#1 in structure) is != "none", which should mean the status of "on" (none should then be "off").

Makes sense?


You can't do that with the Generic JSON device, it doesn't have an on/off status. You need to use the On/Off Sensor Device, and for that to work you need to know what the "on" value is going to be. There's (currently) no way to test for not equal to a value. Or you can go ahead and use the Generic JSON device, then use a Masquerade device to turn that into a Sensor.

Or you might want to use the "concentration" value, and then it would be On if it's not zero (I think).

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

Who is online

Users browsing this forum: No registered users and 2 guests