- Platform information:
- Hardware: R PI4
- OS: Synology DS415+
- openHAB version: 2.04
- Issue of the topic: MQTT query
I don’t know if I should do this with a rule or with a script, can you send me an example?
I have a mqtt string and want to display the values from tool 0,1,2,3,4
the values can look like this, depending on which color I print with, the value behind “filament” is different.
Color white:
… “filament”: {“tool0”: {“volume”: 35.43455963325066, “length”: 5012.964730592337}}},
color orange
… “filament”: {“tool1”: {“volume”: 35.43455963325066, “length”: 5012.964730592337}}},
color green
… “filament”: {“tool2”: {“volume”: 35.43455963325066, “length”: 5012.964730592337}}},
color gray
… “filament”: {“tool3”: {“volume”: 35.43455963325066, “length”: 5012.964730592337}}},
Color: Black
… “filament”: {“tool4”: {“volume”: 35.43455963325066, “length”: 5012.964730592337}}},
the complete mqtt value looks like this when I print with green.
{"_timestamp": 1591433108, “progress”: 16, “printer_data”: {“progress”: {“completion”: 16.000371777137083, “printTimeLeftOrigin”: “genius”, “printTime”: 2010, “printTimeLeft”: 6720, “filepos”: 604247}, “state”: {“text”: “Printing”, “flags”: {“cancelling”: false, “paused”: false, “operational”: true, “pausing”: false, “printing”: true, “resuming”: false, “sdReady”: true, “error”: false, “ready”: false, “finishing”: false, “closedOrError”: false}}, “currentZ”: 3.8, “job”: {“averagePrintTime”: null, “lastPrintTime”: null, “user”: “_api”, “file”: {“origin”: “local”, “name”: “V29D_Fixed_0.15mm_PETG_MK3SMMU2S_2h25m.gcode”, “date”: 1591431097, “path”: “V29D_Fixed_0.15mm_PETG_MK3SMMU2S_2h25m.gcode”, “display”: “V29D_Fixed_0.15mm_PETG_MK3SMMU2S_2h25m.gcode”, “size”: 3776456}, “estimatedPrintTime”: 8787.496217990165, “filament”: {“tool2”: {“volume”: 35.43455963325066, “length”: 5012.964730592337}}}, “offsets”: {“tool4”: 0, “tool3”: 0, “tool2”: 0, “tool1”: 0, “tool0”: 0}}, “location”: “local”, “path”: “V29D_Fixed_0.15mm_PETG_MK3SMMU2S_2h25m.gcode”}
I only want to show the values of the current tool, in this case green,
it should be the screen mirror from 3D printing tool OctoDash under Octoprint.