Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. Node-RED
  4. [Solved] problems trying to save on two measurements

[Solved] problems trying to save on two measurements

Scheduled Pinned Locked Moved Node-RED
2 Posts 1 Posters 533 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Sergio RiusS Offline
    Sergio RiusS Offline
    Sergio Rius
    wrote on last edited by Sergio Rius
    #1

    I'm trying to save the sensor data received from mqtt into two different measurements, if they are internal network messages, I want them in "internal" and all the sensor values into "values"
    For that I tried using a switch module checking the "sensor" attribute being 255, but I can't make it save on the internal "table"

    0_1565787978997_flow.jpg
    0_1565788119103_switch.jpg

    To my confussion, the switch seems to work, as I put debug nodes on the output (1, 2) and it keeps printing 1 or 2 correctly depending on the message.
    But from the two DB/measurement connections that hangs on it only executes the second one. Nothing is written into "internal", although the debug is hit and also the measurement has received the series :scream: :

    key
    ---
    internal,node=0,sensor=255,subType=I_HEARTBEAT_RESPONSE
    internal,node=1,sensor=255,subType=I_DISCOVER_RESPONSE
    values,node=1,sensor=1,subType=V_KWH
    values,node=1,sensor=1,subType=V_VAR1
    values,node=1,sensor=1,subType=V_WATT
    values,node=1,sensor=2,subType=V_WATT
    values,node=1,sensor=3,subType=V_WATT
    values,node=1,sensor=4,subType=V_WATT
    

    Can someone give me a clue of what is happening? I'm newb with node-red and influxdb.

    1 Reply Last reply
    0
    • Sergio RiusS Offline
      Sergio RiusS Offline
      Sergio Rius
      wrote on last edited by Sergio Rius
      #2

      Seems that the problem was that influxdb always configures the field type the first time a series is accessed.
      I thought that the value was something like a "variant" and would eat anything I throw at it. So when I altered the data types in the flow, the db refused to save.
      A drop and re create solved the problem.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      22

      Online

      11.7k

      Users

      11.2k

      Topics

      113.1k

      Posts


      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • MySensors
      • OpenHardware.io
      • Categories
      • Recent
      • Tags
      • Popular