Announcement

Collapse
No announcement yet.

5 (five) lightsensors, and a humidity sensor = how to compare?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    5 (five) lightsensors, and a humidity sensor = how to compare?

    So I have this "old" Z-Wave based system (HC2) where I have five fibaro motion sensors, where I for this challenge uses the light input sensor. And then to top it off I use the humidity sensor for an extra twist on it...

    This is what I am trying to do:

    I use a Virtual Device that tells me if the light is "Dark", "Shadow" or "Bright". It is basically a way to decide when to light up different lights. Or a replacement for sunset / sunrise that handles well bad weather and stuff.

    So here is the formula:
    (<5 * light sensors input>/5) - (humidity * 2) = compare to static values (240 and 350, for dark and bright - between is shadow).

    Any bright ideas how to do this? I seem stuck...

    #2
    Not sure if the Easy Trigger plug-in could do what you need but my initial thought would be to use a script to calculate and populate the virtual device value based on your 5 light and 1 humidity sensors.

    You could either trigger the script on a recurring basis or when any of the input sensors change value.

    Paul..

    Comment


      #3
      Okay, so this seems to be abit of a challenge then.

      So far I have created a Virtual Device that only holds status, and does so in the range -100 to 10000. Then I have got an event that is triggered if any of the light sensors change, and a direct calculation script:
      Code:
      &hs.setDeviceString(306,((hs.deviceValue(254)+(hs.deviceValue(47)+hs.deviceValue(279)+hs.deviceValue(225)/3))/2),True)
      Although that calculation is not with the humidity yet, it does what it is supposed to, and the value in the VD shows something like :"264,2".

      So that works.

      But then I can not trigger any event based on this Virtual Device value...

      I currently have:
      "IF System Magisk Magisk Ljus Sensor was set and has a value that is greater than 300"

      But that never triggers even if the value is higher than 300.

      What is it that I do not get here? Is it string compare instead of decimal value compare? Or what am I doing wrong here?

      Any ideas?

      Comment


        #4
        Try

        Code:
        &hs.setDeiceValueByRef(306, ((hs.deviceValue(254)+(hs.deviceValue(47)+hs.deviceValue(279)+hs.deviceValue(225)/3))/2), True)
        and see if that does it.

        Paul..

        Comment

        Working...
        X