Change Icon automatically

7 years 4 months ago #3852 by dubaleeiro
Hello,

I want to change automatically the icon of a MQTT Node when the main Node parameter achieves a minimum level set in a VIRTUAL Node.
Ist it possible to do it via automation? It seems it is not alloed to change the parameter Settings.Icon automatically...

Thanks!

Please Log in or Create an account to join the conversation.

7 years 4 months ago #3853 by EasyIoT
Replied by EasyIoT on topic Change Icon automatically

dubaleeiro wrote: Hello,

I want to change automatically the icon of a MQTT Node when the main Node parameter achieves a minimum level set in a VIRTUAL Node.
Ist it possible to do it via automation? It seems it is not alloed to change the parameter Settings.Icon automatically...

Thanks!


You can change icon via automation. Just set value of Settings.Icon1 parameter to new icon name via automation.

Please Log in or Create an account to join the conversation.

7 years 4 months ago #3854 by dubaleeiro
Hi,
Thanks a lot for the quick reply.

I tried to do so using the driver Domains.MQTTClient, but I got the following error:

"Domains' does not contain a definition for `MQTTClient'"

This is the code:

{
   EventHelper.ModuleChangedHandler((o, m, p) =>
    {
      // outdoor
      if (m.Domain == Domains.MQTTClient && m.Address == "N2S0" && p.Property == "Sensor.AnalogValue")
        ModuleHelper.SetProperty(Domains.MQTTClient, "N2S0", "Settings.Icon", "accepted.png");     
        return true;
    });
}

Did I do something wrong?
Thanks!

Please Log in or Create an account to join the conversation.

6 years 10 months ago #3898 by dubaleeiro
Dear Forum Admin, could you please take a look at my last question?

Please Log in or Create an account to join the conversation.

6 years 10 months ago #3899 by EasyIoT
Replied by EasyIoT on topic Change Icon automatically

dubaleeiro wrote: Dear Forum Admin, could you please take a look at my last question?


Hi, this is definition of domains class:

public class Domains
{
public const string UNKONOWN = "Unkonown";
public const string AUTOMATION = "Automation";
public const string EASYIOTWEBINTERACE = "EasyIoTWebinterface";
public const string EASYIOTSMSINTERACE = "EasyIoTSMSInterface";
public const string EASYIOTSYSTEM = "EasyIoTSystem";
public const string MYSENSORS = "MySensors";
public const string RPIGPIO = "RPiGPIO";
public const string ESP8266 = "Esp8266";
public const string VIRTUAL = "Virtual";
public const string MQTTCLIENT = "MQTTClient";
}

Please Log in or Create an account to join the conversation.

Time to create page: 0.291 seconds

Forum latest

  • No posts to display.