Invalid subscription filter error on save

User avatar
durosity
Posts: 4810
Joined: Thu May 10, 2012 3:21 pm
Location: Newcastle Upon Tyne, Ye Ol' England.

Invalid subscription filter error on save

Post by durosity »

I'm having a problem setting up my first MQTT device. Apologies if I'm missing something blatantly obvious here.

So I've got Mosquito setup in docker and that's working correctly as best I can tell. MQTT Explorer shows the device as expected:
MQTTExplorer.jpg
MQTTExplorer.jpg (204.07 KiB) Viewed 372 times
I go to the MQTT Plugin and set it up like in the step by step guide (viewtopic.php?t=24227)

When I go to save I get an error at the bottom saying error validating fields, but there's no red labels to check the details about:
MQTTConfig2.jpg
MQTTConfig2.jpg (54.08 KiB) Viewed 371 times
I then get an error in the log:

Code: Select all

    MQTT Connector Error            Error in plugin execution UiValidate:

  File "plugin.py", line 635, in validateDeviceConfigUi
  File "/Library/Application Support/Perceptive Automation/Indigo 2025.1/Plugins/MQTT Connector.indigoPlugin/Contents/Server Plugin/mqtt_broker.py", line 98, in subscribe
  File "/Library/Application Support/Perceptive Automation/Indigo 2025.1/Plugins/MQTT Connector.indigoPlugin/Contents/Packages/paho/mqtt/client.py", line 1491, in subscribe
type: Invalid subscription filter.
I'm floundering at this point.. any pointers on where I'm going wrong?
Computer says no.
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Invalid subscription filter error on save

Post by FlyingDiver »

I'm not sure you can put a wildcard "#" in a topic string, except by itself. So put a slash before the hash.

Joe
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
durosity
Posts: 4810
Joined: Thu May 10, 2012 3:21 pm
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Invalid subscription filter error on save

Post by durosity »

Ah damn, I thought I had it copied exactly! :oops:

So, now it's saying, and I'm seeing the field details in last_payload with the relevant info, so it's seeing it! But now I'm struggling with the trigger/Shim.

The trigger is setup correctly as best I can tell:
MQTTTrigger.jpg
MQTTTrigger.jpg (53.43 KiB) Viewed 361 times
And this is the shim device config:
shimconfig.jpg
shimconfig.jpg (86.99 KiB) Viewed 361 times
But It's not getting any updates or values or anything, just says sensor value 0 and the last update at the generic 2000-01-01. I've tried as many different permutations of the setup as I can, but nothing seems to make a difference.

Edit: I'm still having issues, but I've found the 'Device report energy usage' tick box, but I'm not sure what should go in the Energy Payload Key field? The device I'm using is a Athom Plug V2 from Tasmota and is just a power meter, doesn't even have a relay in it, so I'm guessing this is a rather important field :D
Computer says no.
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Invalid subscription filter error on save

Post by FlyingDiver »

Your match trigger is wrong. The last term in the topic is "SENSOR". So remove the "any" or change it to "end".
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: Invalid subscription filter error on save

Post by FlyingDiver »

And your shim device is wrong. That's a JSON payload, not a RAW payload.
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: Invalid subscription filter error on save

Post by FlyingDiver »

Your unique ID value is the tasmota_XXX field of the topic. which is location 1. ReactivePower is the key for the JSON payload.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
durosity
Posts: 4810
Joined: Thu May 10, 2012 3:21 pm
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Invalid subscription filter error on save

Post by durosity »

I think the trigger is now right as I'm getting triggers showing in my event log, but I'm still not getting anything coming through to the shim:
config6.jpg
config6.jpg (110.11 KiB) Viewed 334 times
Trigger screenshot too in case I've somehow screwed it up too :D
Screenshot 2025-12-12 at 23.08.18.png
Screenshot 2025-12-12 at 23.08.18.png (98.69 KiB) Viewed 334 times
EDIT:
Ah now, I just saw an error appear in the log:

MQTT Shims Error Dishwasher Power: update() is unable to convert 'None' to float

So it's clearly getting something.. but 'nothing' suggests it's not getting the right value from the JSON.
Computer says no.
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Invalid subscription filter error on save

Post by FlyingDiver »

I might be able to tell more from debug logs. But without seeing the actual payload contents it's going to be difficult.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
durosity
Posts: 4810
Joined: Thu May 10, 2012 3:21 pm
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Invalid subscription filter error on save

Post by durosity »

Does this from the device last_payload field help?

Code: Select all

{"Time":"2025-12-13T03:22:17","ENERGY":{"TotalStartTime":"2025-12-12T19:42:10","Total":0.292,"Yesterday":0.227,"Today":0.065,"Period":0,"Power":1,"ApparentPower":8,"ReactivePower":8,"Factor":0.09,"Voltage":240,"Current":0.034}}
I've also tried it with other values from the list but no joy.

This is the current subscriptions:

MQTT Connector MQTT Tasmota: Current topic subscriptions:
MQTT Connector MQTT Tasmota: 3Atele/tasmota_575128 (0)
MQTT Connector MQTT Tasmota: 3Atele/tasmota_575128/SENSOR (0)
MQTT Connector MQTT Tasmota: 3Atele/tasmota_575128/SENSOR/%23 (0)

And from the Shims plugin:

MQTT Shims
message_type: '##SENSOR##'
props:
SupportsSensorValue: true
shimSensorPrecision: '2'
shimSensorSubtype: Current
state_location: payload
state_location_payload_key: Current
state_location_payload_type: json
state_location_topic_field: '0'
uid_location: topic
uid_location_topic_field: '1'
trigger:
match_list: '["Match: tele", "Match: tasmota_575128", "Match: SENSOR"]'
queueMessage: true
type: shimValueSensor

Oddly.. I've turned on the detailed debug on the shims plugin.. and the error (that appears every 5 mins) just doesn't appear.


Device details in case it helps:

Code: Select all

address : tasmota_575128
allowOnStateChange : False
allowSensorValueChange : False
batteryLevel : None
buttonGroupCount : 0
configured : True
description : 
deviceTypeId : shimValueSensor
displayStateId : sensorValue
displayStateImageSel : SensorOff
displayStateValRaw : 0.0
displayStateValUi : 0
enabled : True
energyAccumBaseTime : None
energyAccumTimeDelta : None
energyAccumTotal : None
energyCurLevel : None
errorState : 
folderId : 0
globalProps : MetaProps : (dict)
     com.flyingdiver.indigoplugin.shims : (dict)
          SupportsBatteryLevel : false (bool)
          SupportsEnergyMeter : false (bool)
          SupportsEnergyMeterCurPower : false (bool)
          SupportsOnState : false (bool)
          SupportsSensorValue : true (bool)
          SupportsStatusRequest : false (bool)
          address : tasmota_575128 (string)
          adjustmentFunction :  (string)
          battery_payload_key :  (string)
          brokerID : 486960005 (string)
          custom_decoder :  (string)
          energy_payload_key :  (string)
          message_type : ##SENSOR## (string)
          power_payload_key :  (string)
          shimSensorPrecision : 2 (string)
          shimSensorSubtype : Current (string)
          state_dict_payload_key :  (string)
          state_location : payload (string)
          state_location_payload_key : Current (string)
          state_location_payload_type : json (string)
          state_location_topic_field : 0 (string)
          states_list : (list)
          status_action_payload :  (string)
          status_action_template :  (string)
          uid_location : topic (string)
          uid_location_payload_key :  (string)
          uid_location_topic_field : 1 (string)
id : 1622593404
lastChanged : 2000-01-01 00:00:00
lastSuccessfulComm : 2000-01-01 00:00:00
model : MQTT Value Sensor Device
name : Dishwasher Power
onState : None
ownerProps : com.flyingdiver.indigoplugin.shims : (dict)
     SupportsBatteryLevel : false (bool)
     SupportsEnergyMeter : false (bool)
     SupportsEnergyMeterCurPower : false (bool)
     SupportsOnState : false (bool)
     SupportsSensorValue : true (bool)
     SupportsStatusRequest : false (bool)
     address : tasmota_575128 (string)
     adjustmentFunction :  (string)
     battery_payload_key :  (string)
     brokerID : 486960005 (string)
     custom_decoder :  (string)
     energy_payload_key :  (string)
     message_type : ##SENSOR## (string)
     power_payload_key :  (string)
     shimSensorPrecision : 2 (string)
     shimSensorSubtype : Current (string)
     state_dict_payload_key :  (string)
     state_location : payload (string)
     state_location_payload_key : Current (string)
     state_location_payload_type : json (string)
     state_location_topic_field : 0 (string)
     states_list : (list)
     status_action_payload :  (string)
     status_action_template :  (string)
     uid_location : topic (string)
     uid_location_payload_key :  (string)
     uid_location_topic_field : 1 (string)
pluginId : com.flyingdiver.indigoplugin.shims
pluginProps : emptyDict : (dict)
protocol : Plugin
remoteDisplay : True
sensorValue : 0.0
sharedProps : com.indigodomo.indigoserver : (dict)
states : States : (dict)
     sensorValue : 0 (real)
subModel : 
subType : 
supportsAllLightsOnOff : False
supportsAllOff : False
supportsOnState : False
supportsSensorValue : True
supportsStatusRequest : False
version : None
Computer says no.
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Invalid subscription filter error on save

Post by FlyingDiver »

That JSON payload has nested dictionaries. Try using "ENERGY. ReactivePower" as the payload key.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
durosity
Posts: 4810
Joined: Thu May 10, 2012 3:21 pm
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Invalid subscription filter error on save

Post by durosity »

FlyingDiver wrote: Sat Dec 13, 2025 8:46 am That JSON payload has nested dictionaries. Try using "ENERGY. ReactivePower" as the payload key.
Unfortunately no difference :(
Computer says no.
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Invalid subscription filter error on save

Post by FlyingDiver »

Hmm. Unfortunately I'm leaving on holiday in a few hours, so I won't be able to follow up on this again until after Christmas. Before then, please enable debug logging on both the connector and shim plugins, and extract the section that just shows one instance of the connector receiving the message and the shim plugin processing it.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
durosity
Posts: 4810
Joined: Thu May 10, 2012 3:21 pm
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Invalid subscription filter error on save

Post by durosity »

I will do that for you! Hope you enjoy your holiday!
Computer says no.
cuhouse
Posts: 151
Joined: Wed Feb 21, 2007 4:10 pm
Location: Virginia, USA

Re: Invalid subscription filter error on save

Post by cuhouse »

Durosity,

Your thread gave me the push to configure a Shim device that I have needed for awhile. I got mine working and then set up your scenario. Used the payload you supplied in this thread. I published it to my Shim device using MQTT Explorer and I was able to see the value update on my device. I changed the ReactivePower a few times and it updated.

This is what I used for my device.
Screen Shot 2025-12-13 at 11.44.26 PM.png
Screen Shot 2025-12-13 at 11.44.26 PM.png (105.04 KiB) Viewed 233 times
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).
User avatar
durosity
Posts: 4810
Joined: Thu May 10, 2012 3:21 pm
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Invalid subscription filter error on save

Post by durosity »

cuhouse wrote: Sat Dec 13, 2025 10:54 pm Your thread gave me the push to configure a Shim device that I have needed for awhile. I got mine working and then set up your scenario. Used the payload you supplied in this thread. I published it to my Shim device using MQTT Explorer and I was able to see the value update on my device. I changed the ReactivePower a few times and it updated.

This is what I used for my device.
BAM! That was it! It was almost correct, I just had a space between the ENERGY. and ReactivePower.

Out of interest, I only seem to be getting an update of the power every 5 mins.. but it's updating a lot more frequently in the MQTT Explorer application.. are you aware of anything that could be causing that?
Computer says no.
Post Reply

Return to “MQTT”