Get Temperature from other nodes(through VERA).



  • Hi,

    I'm have started to plan a irrigation controller(Thanx @petewill).
    But I need to get the temperature from my sensors to my controller. I have not been able to do this :(

    My plan was to read this out from my vera controller, but cant find any way to do this.
    Does anyone have a advice or idea to do this ?

    I'm using the V2.0.0, of library.
    I have tried to use the
    request(tempNode_ID, V_TEMP) But no replay from VERA.
    To store/update the "setTemp" I'm using the V_VAR1 on the and this is returned from VEAR.

    So Is this possible or not ?

    Thanx


  • Hero Member

    Hi @clio75

    Here is an example of the lua I use when sending V_VAR1 to a MySensors Node:
    16 is the id of the device from where I get the temperature value.
    24 is the id of the MySensors plugin main device
    11;3 is the altid of the MySensors node device to witch I'm sending the value.

    local temp = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1","CurrentTemperature", 16)
    luup.call_action("urn:upnp-arduino-cc:serviceId:arduino1", "SendCommand", {radioId="11;3", variableId="VAR_1", value=temp}, 24)
    

    Here is an example of the receive code in the node itself:

    void receive(const MyMessage &message)
    {
      if (message.type == V_VAR1)
      {
        OutdoorTemp = String(message.data);
        //Serial.print("OutdoorTemp recieved:");
        //Serial.println(OutdoorTemp);
      }  
    }
    


  • hi @korttoma

    Thanx for your suggestion, But I was not able to figure out where to insert this LUA code.

    Thanx


  • Hero Member

    @clio75 you could add it as an action in a scene under "Also, execute the following Luup code:".

    The way I use it is to send weather information to a small display node so I have a PLEG condition running every 10min to update the information. So I have the lua code as an action for the PLEG condition.



  • @korttoma

    Thanx, I will Try again this afternoon :)



  • @korttoma
    Thanx this is working perfect.



  • Hi @korttoma,

    Just an other question,
    II'm also using PLEG.
    Is there a way to compeer the last value against the new value and only IF these values are different we sending a this new value.

    some thing like :
    local temp = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1","CurrentTemperature", 35)
    local oldTemp = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1","VAR_1", 14)
    if temp != oldTemp then
    luup.call_action("urn:upnp-arduino-cc:serviceId:arduino1", "SendCommand", {radioId="14;2", variableId="VAR_1", value=temp}, 3)
    end
    Thanx


Log in to reply
 

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.