GET request on automation

8 years 7 months ago - 8 years 7 months ago #2258 by NightOne
Replied by NightOne on topic GET request on automation
glad you got it fixed cause I noticed that my advice was wrong, so I thought I would at least fix my mistake.

if (m.Domain == Domain.VIRTUAL && m.Address == "N5S0" && p.Property == "Sensor.Temperature" && p.Value=="15") is wrong it should be if (m.Domain == Domain.VIRTUAL && m.Address == "N5S0" && p.Property == "Sensor.Temperature")

This means the event handle with trigger each time something changes in Sensor.Temperature, if you want to trigger an event at a specifc value then you would write and if statement like
if (m.Domain == Domain.VIRTUAL && m.Address == "N5S0" && p.Property == "Sensor.Temperature");
if (p.Value == "15") etc etc

If you dont have a second if statement then the code with run whenever there is a change to Sensor.Temperature

I write this mainly for the benefit of the poor sucker who tried to make sense of my earlier mistake

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

Time to create page: 0.246 seconds

Forum latest

  • No posts to display.