Missing something

Posted on
Tue Jul 12, 2022 7:02 pm
nathanw offline
Posts: 152
Joined: Sep 05, 2011
Location: Boston, MA

Missing something

I haven't done much with MQTT, though I've had a broker on my network for a while.

I have a script publishing readings from my gas meter to topic=readings/25170699/meter_reading with a raw integer value. (I could change any of this if it helps).

I set up a MQTT Connector device pointing to the broker, subscribed it to readings/#, and created a trigger event on the topic component match. I created a MQTT Shim device ("MQTT Value Sensor Device") with the intent of capturing the incoming value.

However, whenever a message comes in, I get something like this:
Code: Select all
   Trigger                         receive gas
   MQTT Shims Debug                message_handler: MQTT message ##gas## from Docker MQTT
   MQTT Shims Debug                gas meter: processMessages: '##gas##' readings/99978223/meter_reading -> 2494
   MQTT Shims Debug                gas meter: Raw payload = 2494
   MQTT Shims Debug                gas meter: states_key=
   MQTT Shims Debug                gas meter: update adjustmentFunction: ''
   MQTT Shims Debug                gas meter: Updating state to 2494.0
   Error                           device "gas meter" state key sensorValue not defined (ignoring update request)
   Error                           device "gas meter" state key sensorValue not defined (ignoring update request)


What am I missing? What should be creating the actual value here?

Posted on
Tue Jul 12, 2022 7:19 pm
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Missing something

Post a screenshot of the Shim config.

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

Posted on
Wed Jul 13, 2022 2:31 pm
nathanw offline
Posts: 152
Joined: Sep 05, 2011
Location: Boston, MA

Re: Missing something

Attached.
Attachments
Screen Shot 2022-07-13 at 4.30.30 PM.png
Screen Shot 2022-07-13 at 4.30.30 PM.png (509.46 KiB) Viewed 1866 times

Posted on
Wed Jul 13, 2022 4:26 pm
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Missing something

Very strange. That all looks correct. Please use the context (right click) menu command to write the device details to the log and then post it here.

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

Posted on
Wed Jul 13, 2022 4:27 pm
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Missing something

Oh and confirm what plug-in version you’re running.

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

Posted on
Wed Jul 13, 2022 7:14 pm
nathanw offline
Posts: 152
Joined: Sep 05, 2011
Location: Boston, MA

Re: Missing something

Indigo 2022.1.2
MQTT Connector 2022.0.4
MQTT Shims 2022.0.5

Code: Select all
   Script                          address : 99978223
allowOnStateChange : False
allowSensorValueChange : False
batteryLevel : None
buttonGroupCount : 0
configured : True
description :
deviceTypeId : shimValueSensor
displayStateId :
displayStateImageSel : EnergyMeterOn
displayStateValRaw : None
displayStateValUi :
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 : false (bool)
          SupportsStatusRequest : false (bool)
          address : 99978223 (string)
          adjustmentFunction :  (string)
          battery_payload_key :  (string)
          brokerID : 1058699061 (string)
          energy_payload_key :  (string)
          message_type : ##gas## (string)
          power_payload_key :  (string)
          shimSensorPrecision : 2 (string)
          shimSensorSubtype : Power-W (string)
          state_dict_payload_key :  (string)
          state_location : payload (string)
          state_location_payload_key :  (string)
          state_location_payload_type : raw (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 : 1467679379
lastChanged : 2022-07-13 21:13:39
lastSuccessfulComm : 2022-07-13 21:13:39
model : MQTT Value Sensor Device
name : gas meter
onState : None
ownerProps : com.flyingdiver.indigoplugin.shims : (dict)
     SupportsBatteryLevel : false (bool)
     SupportsEnergyMeter : false (bool)
     SupportsEnergyMeterCurPower : false (bool)
     SupportsOnState : false (bool)
     SupportsSensorValue : false (bool)
     SupportsStatusRequest : false (bool)
     address : 99978223 (string)
     adjustmentFunction :  (string)
     battery_payload_key :  (string)
     brokerID : 1058699061 (string)
     energy_payload_key :  (string)
     message_type : ##gas## (string)
     power_payload_key :  (string)
     shimSensorPrecision : 2 (string)
     shimSensorSubtype : Power-W (string)
     state_dict_payload_key :  (string)
     state_location : payload (string)
     state_location_payload_key :  (string)
     state_location_payload_type : raw (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 : None
sharedProps : com.indigodomo.indigoserver : (dict)
states : States : (dict)
subModel :
subType :
supportsAllLightsOnOff : False
supportsAllOff : False
supportsOnState : False
supportsSensorValue : False
supportsStatusRequest : False
version : None

Posted on
Wed Jul 13, 2022 7:52 pm
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Missing something

Did you create this device as is, or did you start with a different device type then change it?

Try creating a new device and make sure you select the value sensor from the start. Use the same config data as the one you have now.

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

Posted on
Wed Jul 13, 2022 8:53 pm
nathanw offline
Posts: 152
Joined: Sep 05, 2011
Location: Boston, MA

Re: Missing something

I probably did create it first as "generic device", just because I wasn't quite sure what fit, and then changed it to "sensor device".

Deleted and recreated as a sensor device, and indeed, I now see no error and the value seems associated with the device.

(While I've got you here, having CCF/HCF in the units would be nice - I believe cubic feet of gas is what is being measured here, so CCF and two decimal places would do the job).

Posted on
Thu Jul 14, 2022 3:25 pm
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Missing something

nathanw wrote:
(While I've got you here, having CCF/HCF in the units would be nice - I believe cubic feet of gas is what is being measured here, so CCF and two decimal places would do the job).


Create a GitHub issue for the plugin for this.

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

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest

cron