MQTTImport and use of formula
Posted: 11 Jan 2018, 15:09
I am using MQTTImport to set a dimmer level (PWM) using MQTT. This works fine as long as I put the PWM dutycycle (1..1024) in the MQTT message payload.
This means that the controller (Domoticz) has to know the range of PWM-levels and convert the dimmer level (0-100%) to PWM.
I'd rather have this conversion done in ESPEasy because the max PWM level is also depending on the type of PWM (native or PCA9685).
I tried to use the formula in the device setting but this seems to be ignored by the plugin. I also tried to do the math in rules (see below) but that does not seem to work either; the PWM level is set to the input level and ignores the formula.
Any ideas on how to implement this?
This means that the controller (Domoticz) has to know the range of PWM-levels and convert the dimmer level (0-100%) to PWM.
I'd rather have this conversion done in ESPEasy because the max PWM level is also depending on the type of PWM (native or PCA9685).
I tried to use the formula in the device setting but this seems to be ignored by the plugin. I also tried to do the math in rules (see below) but that does not seem to work either; the PWM level is set to the input level and ignores the formula.
Code: Select all
on DimmerImport#Level do
PWM,14,[DimmerImport#Level]*1024/100,1250
endon