Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How correct variable? #12

Open
meloman27 opened this issue Mar 18, 2021 · 4 comments
Open

How correct variable? #12

meloman27 opened this issue Mar 18, 2021 · 4 comments

Comments

@meloman27
Copy link

meloman27 commented Mar 18, 2021

Hi!

Thank you for this great plugin! Please help, how correct variable from topic?

[WemosTemperature]
Measure=Plugin
Plugin=MqttClient
ParentName=mqttServer
Topic=tele/wemos_01/Sensor
Property=BME280.Temperature

This not working:

[MeasureWemosTemperatureCorr]
Measure=Calc
Formula=WemosTemperature - 1.3

@meloman27 meloman27 changed the title How correct var How correct variable? Mar 18, 2021
@fvanroie
Copy link
Owner

fvanroie commented Mar 18, 2021

What is the payload that is published on topic tele/wemos_01/Sensor and is WemosTemperature displaying the value from MQTT?

@meloman27
Copy link
Author

meloman27 commented Mar 18, 2021

topic: tele/wemos_01/Sensor:
{"Time":"2021-03-18T20:29:32","BME280":{"Temperature":29.0,"Humidity":18.6,"Pressure":742.6},"PressureUnit":"mmHg","TempUnit":"C"}

[mqttOutput]
Meter=String
AutoScale=1
MeasureName=WemosTemperature
Text=%1

Out: 29,0
I want to assign a variable to correct a out temperature digit.

@fvanroie
Copy link
Owner

fvanroie commented Mar 18, 2021

You probably need

[MeasureWemosTemperatureCorr]
Measure=Calc
Formula=[WemosTemperature] - 1.3
DynamicVariables=1

Check https://docs.rainmeter.net/tips/measure-as-a-variable/

@meloman27
Copy link
Author

meloman27 commented Mar 18, 2021

Victory!

[WemosTemperature]
Measure=Plugin
Plugin=MqttClient
ParentName=mqttServer
Topic=tele/wemos_01/Sensor
Property=BME280.Temperature
Substitute=",":"."

[WemosTemperatureCorr]
Measure=Calc
Formula=[WemosTemperature] - 1.3
DynamicVariables=1

The plugin replaces the dot separator with a comma on result and the function Calc cannot process the value as a number. After replaces separator with function Substitute=",":"." function Calc worked. Please correct this bug on plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants