Shims SetUp

farberm
Posts: 393
Joined: Sun Feb 24, 2008 2:14 pm

Shims SetUp

Post by farberm »

I am trying to get MQTT to work with my Generator, however I am not getting any values for the Shim...

I have a MQTT Server set up on my Synology NAS. It is set to communicate with my Generator's MQTT. I know that it is publishing topics because I can see values using MQTTlens (Figure 6). I have set up the MQTT Connector to connect to the MQTT Server (Figure 5). I have the topic subscriptions listed (Figure 4). No other additional setup done under MQTT Connector.

SHOULD I DO . MORE FOR THE MQTT BROKER SETUP???

now for setting up Shim...

First set up trigger...
I choose my Broker - Synology, selected Match and entered three Strings.. Utility voltage, Battery Voltage and Temperature with message type ##generator## (Figure 3). I entered always and left the action as No action.... IS THIS CORRECT or do I need to do a specific action???

Now created a MQTT Shim...
I created a shim as a value sensor with message type ##generator## Topic Component 1 with ID value of voltage. I choose PAYLOAD Fields, JSON . (Figure 2)

BUT I AM NOT SURE WHAT THE PAYLOAD KETY SHOULD BE???? - I choose value and left the sensor type as Generic.

I do not get a value listed .. (Figure 1). I also did it similarly for ambient temperature also without success..

Any and all help would be appreciated.
Attachments
Screen Shot 2020-02-15 at 1.28.51 PM.png
Screen Shot 2020-02-15 at 1.28.51 PM.png (39.03 KiB) Viewed 2992 times
Screen Shot 2020-02-15 at 1.24.32 PM.png
Screen Shot 2020-02-15 at 1.24.32 PM.png (211.86 KiB) Viewed 2992 times
Screen Shot 2020-02-15 at 1.17.45 PM.png
Screen Shot 2020-02-15 at 1.17.45 PM.png (184.61 KiB) Viewed 2992 times
Screen Shot 2020-02-15 at 1.12.16 PM.png
Screen Shot 2020-02-15 at 1.12.16 PM.png (314.86 KiB) Viewed 2992 times
Screen Shot 2020-02-15 at 1.11.28 PM.png
Screen Shot 2020-02-15 at 1.11.28 PM.png (250.77 KiB) Viewed 2992 times
Screen Shot 2020-02-15 at 1.08.36 PM.png
Screen Shot 2020-02-15 at 1.08.36 PM.png (92.9 KiB) Viewed 2992 times
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Shims SetUp

Post by FlyingDiver »

Ok, there's a number of issues with your setup. Did you follow the wiki article? https://github.com/FlyingDiver/Indigo-S ... asic-Setup

First, you probably just want to subscribe to "generator/#". '#' is the MQTT wildcard. Doing it with specific topics is error-prone.

Second, your trigger setup is all wrong. You don't set up matches for ANY topic you're interested in, you set it up for a SPECIFIC topic. And you do that by listing each topic component, in order that they appear. So I think you want:

Code: Select all

Match: generator
Match: Status
Match: Line
Match: Utility Voltage
Match: value
End:
Since you checked the "queue message" box, no explicit actions are required.

Third, you have the "Payload Type" wrong. Looking at the MQTTLens screen shot, the topic "generator/Status/Line/Utility Voltage/value" is a simple "244". Which is not JSON, so you want that field to be "Raw". Which doesn't have a payload key.

I don't have a Voltage type, so Generic is fine. Might as well set the Precision to 0, since the data doesn't have any decimals.

I think that's all.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
farberm
Posts: 393
Joined: Sun Feb 24, 2008 2:14 pm

Re: Shims SetUp

Post by farberm »

ok Fixed those things..

1. Changed Subscribe to # only and deleted all others
2. Changed trigger to have all parts of topic string - generator, Status, Line. Utility Voltage, and value (Figure3). I also renamed Message type to ##voltage##
3. Adjusted Shim to be Topic Field 4.

I still have State as 0 and getting an error -
I include the debug log if that helps.

I am sure I have something set wrong in the Shim Setup now.

Trigger MQTT Shim Trigger-Voltage
MQTT Shims Debug received notification of MQTT message type ##voltage## from Synology Mosquito Server
MQTT Connector Debug Synology Mosquito Server: fetchQueuedMessageAction, queue = ##voltage## (1)
MQTT Shims Debug Voltage MQTT: processMessages: '##voltage##' generator/Status/Line/Utility Voltage/value -> 245
MQTT Shims Threaddebug Voltage MQTT: update topic message_address = value
MQTT Shims Debug Voltage MQTT: update address mismatch: voltage != value
MQTT Connector Debug Synology Mosquito Server: queueMessageForDispatchAction, queue = ##voltage## (1)
Attachments
Screen Shot 2020-02-15 at 3.00.26 PM.png
Screen Shot 2020-02-15 at 3.00.26 PM.png (258.45 KiB) Viewed 2973 times
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Shims SetUp

Post by FlyingDiver »

farberm wrote:ok Fixed those things..

1. Changed Subscribe to # only and deleted all others
2. Changed trigger to have all parts of topic string - generator, Status, Line. Utility Voltage, and value (Figure3). I also renamed Message type to ##voltage##
3. Adjusted Shim to be Topic Field 4.
Your unique ID for this device is "generator". Change that to field 0 and put in "generator". There is no topic component with the term 'voltage'.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
farberm
Posts: 393
Joined: Sun Feb 24, 2008 2:14 pm

Re: Shims SetUp

Post by farberm »

worked.
farberm
Posts: 393
Joined: Sun Feb 24, 2008 2:14 pm

Re: Shims SetUp

Post by farberm »

Flying Diver (sorry to bother you again):

I have all the numeric payloads working and have that figured out. I am still having problems understanding the JSON based payloads.

I re-read the Wiki...and I am trying to get the Ambient Temperature sensor Shimm set up.

1. Set up trigger (Figure 2 and 3).
Match: generator
Match: Maintenance
Match: Ambient Temperature Sensor

type ##temp##

2.Shim Setup
a. Topic component should be the second in the list (according to the wiki) so I choose Maintenance and Field 1
b. Payload Key is likely where I am having problems. Based on Figure 3 the value it is 32 F
i. Since I do not have the payload visually as it is in the wiki I tried several options without success for the JSON payload
I so I choose several - Ambient Temperature Sensor, Maintenance.Ambeint Temperature Sensor - both do not work.

I AM GETTING THIS ERROR IN THE EVENT LOG:

Trigger MQTT Shim Trigger-Temperature
MQTT Shims Debug received notification of MQTT message type ##temp## from Synology Mosquito Server
MQTT Connector Debug Synology Mosquito Server: fetchQueuedMessageAction, queue = ##temp## (1)
MQTT Shims Debug Temp: processMessages: '##temp##' generator/Maintenance/Ambient Temperature Sensor -> 36 F
MQTT Shims Threaddebug Temp: update topic message_address = Maintenance
MQTT Shims Debug Temp: JSON decode error for state_location = payload, aborting
MQTT Connector Debug Synology Mosquito Server: queueMessageForDispatchAction, queue = ##voltage## (1)


If I choose RAW for the type I get the following error

MQTT Shims Error Temp: update unable to convert '36 F' to float: invalid literal for float(): 36 F
Attachments
Screen Shot 2020-02-16 at 10.10.39 AM.png
Screen Shot 2020-02-16 at 10.10.39 AM.png (194.01 KiB) Viewed 2884 times
Screen Shot 2020-02-16 at 9.57.52 AM.png
Screen Shot 2020-02-16 at 9.57.52 AM.png (242.4 KiB) Viewed 2884 times
Screen Shot 2020-02-16 at 9.39.50 AM.png
Screen Shot 2020-02-16 at 9.39.50 AM.png (43.33 KiB) Viewed 2884 times
cuhouse
Posts: 151
Joined: Wed Feb 21, 2007 4:10 pm
Location: Virginia, USA

Re: Shims SetUp

Post by cuhouse »

The payload type for this is RAW like your last device. Program it the same.

I think you would still use this guidance from Joe for this one too:
Your unique ID for this device is "generator". Change that to field 0 and put in "generator".'.
Indigo 2024.1, Monterey v12.7.6, Dedicated late 2014 Mac Mini, PowerLinc 2413U, Shelly/ShellyNG, Lutron Caséta Smart Bridge PRO (L-BDGPRO2-WH).
farberm
Posts: 393
Joined: Sun Feb 24, 2008 2:14 pm

Re: Shims SetUp

Post by farberm »

cuhouse - yes I got the voltage one to work. I am not working on the last post about temperature. That on seems to not be a raw value but a JSON payload correct?
cuhouse
Posts: 151
Joined: Wed Feb 21, 2007 4:10 pm
Location: Virginia, USA

Re: Shims SetUp

Post by cuhouse »

Your MQTTLens output does not look like a JSON payload. I would use RAW like you did on your last device.
Indigo 2024.1, Monterey v12.7.6, Dedicated late 2014 Mac Mini, PowerLinc 2413U, Shelly/ShellyNG, Lutron Caséta Smart Bridge PRO (L-BDGPRO2-WH).
farberm
Posts: 393
Joined: Sun Feb 24, 2008 2:14 pm

Re: Shims SetUp

Post by farberm »

This is the error when I choose raw:

Trigger MQTT Shim Trigger-Temperature
MQTT Shims Debug received notification of MQTT message type ##temp## from Synology Mosquito Server
MQTT Connector Debug Synology Mosquito Server: fetchQueuedMessageAction, queue = ##temp## (1)
MQTT Shims Debug Temp: processMessages: '##temp##' generator/Maintenance/Ambient Temperature Sensor -> 38 F
MQTT Shims Threaddebug Temp: update topic message_address = Ambient Temperature Sensor
MQTT Shims Threaddebug recurseDict key_string = value, data_dict= {'value': u'38 F'}
MQTT Shims Debug Temp: shimValueSensor, key = value, data = {'value': u'38 F'}, value = 38 F
MQTT Shims Error Temp: update unable to convert '38 F' to float: invalid literal for float(): 38 F
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Shims SetUp

Post by FlyingDiver »

If you don't see curly braces "{}" in the payload string, it's not JSON.

You should be using Raw, but you get this error:

Code: Select all

MQTT Shims Error Temp: update unable to convert '36 F' to float: invalid literal for float(): 36 F
That's because the payload string isn't just the temperature ("36"), it's formatted: "36 F". Which breaks the string to float conversion.

Unless there's another topic that has JUST the number in it, you're stuck without this until I can figure out a way to make the plugin handle this case.

Is there also a topic "generator/Status/Line/Ambient Temperature Sensor/value"?
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
farberm
Posts: 393
Joined: Sun Feb 24, 2008 2:14 pm

Re: Shims SetUp

Post by farberm »

No there is not a topic with value like the others
farberm
Posts: 393
Joined: Sun Feb 24, 2008 2:14 pm

Re: Shims SetUp

Post by farberm »

I have my system set to send JSON as numberics. I can send them as KSON instead. Let me see if that helps.
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Shims SetUp

Post by FlyingDiver »

farberm wrote:No there is not a topic with value like the others
Then you'll need to wait until I can figure out if there's a way to deal with this situation.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Shims SetUp

Post by FlyingDiver »

farberm wrote:I have my system set to send JSON as numberics. I can send them as KSON instead. Let me see if that helps.
I have no idea what KSON is.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
Post Reply

Return to “MQTT”