how to get data from controller?



  • Hi,
    is it possible that my sensor can call a value from the controller?
    Scenario:
    Flow Sensor sends the total liter to the controller, after rebooting the sensor total liters will be 0 again. So the idea is to get the last value from the controller at startup.
    I haven´t find anything like this. Is there a function?


  • Hero Member

    @vga You can with the gw.request function. Many of the controllers seem to have in not implemented (eg. Domoticz). For your scenario it would be a good solution to store the values in EEPROM (gw.saveState() (be aware that it only takes byte values



  • @AWI Are you sure about Domoticz? I am sure that a pulse meter node is requesting value from Domoticz every time it powers up and it is working.

    // Fetch last known pulse count value from gw
      gw.request(CHILD_ID, V_VAR1);
      
      attachInterrupt(INTERRUPT, onPulse, RISING);
      lastSend=lastPulse=millis();
    
    

  • Hero Member

    @alexsh1 you van get data from some specific variables, text and switches, but not for all sensors.



  • @vga What's your controller please?

    @AWI It covers most of the things, no? Electricity pulse meter and water pulse meter. I have not come up with another example when gw.request may be applied.


  • Hero Member

    @alexsh1 you can use special variables to store and retrieve values. These are not available in the Domoticz interface.
    As far as I know only switches, text and a very domoticz specific custom value can be retrieved. You can find some discussion on the Domoticz forum.



  • @AWI yes I spoke to Rob about it some time ago. V_VAR is good enough for my needs. I just do not see why one would want more


Log in to reply
 

Suggested Topics

  • 1
  • 2
  • 2
  • 5
  • 10
  • 2

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts