Shims error and feature request

Posted on
Sat Aug 15, 2020 2:00 pm
kmarkley offline
Posts: 185
Joined: Nov 15, 2016

Shims error and feature request

I'm trying to bring my 3D printer status into indigo via octoprint and MQTT. I have it working for key states, but am encountering an error when using the Multi-State Key:
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 416, in update
StandardError: LowLevelBadParameterError -- illegal character in XML tag name or value
This is apparently because some JSON keys begin with an underscore. Here's a sample payload:
Code: Select all
{
"state_string": "Operational"
"_timestamp": 1597520731
"_event": "PrinterStateChanged"
"state_id": "OPERATIONAL"
}
Would it be possible to strip leading underscores when creating device states?

Relatedly, would it be possible to (optionally) define a display state for on/off sensor devices? In my case, I'd like the display state to equal the "state_string" JSON key and the the on condition to be "state_string" == "Operational".

Thanks.

Posted on
Sat Aug 15, 2020 2:04 pm
FlyingDiver offline
User avatar
Posts: 7216
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Shims error and feature request

Would you mind creating GitHub issues for the key error?

For the other, once the key error is fixed you can probably get what you want using the Masquerade plugin. If that's not going to work, maybe I can do something in Shims.

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

Posted on
Sat Aug 15, 2020 2:11 pm
kmarkley offline
Posts: 185
Joined: Nov 15, 2016

Re: Shims error and feature request

Done

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests