Can a Node Send json?



  • Please forgive my ignorance but I have searched and searched and not found what I was looking for. Please help.

    I am making an RFID garage door opener (another) using the MIFARE Classic tags and a MySensors Node. It differs in that I am using the tags to store the tag holder name and encryption keys A & B (I know the generic MIFARE classic encryption has been hacked). What I am trying to do is send the card holders name, time scanned, time access granted or denied to Domoticz. I initially tried a text sensor (V_TEXT) but it only held 16 characters. However using json I can enter up to 40 easily. I can't use the Domoticz logs because from what I have found they only hold their log for several days at the max. I would rather have a dedicated log just for the garage door RFID system.

    My question is, is there a way to send a json command through the mysensors network to my Ethernet gateway then onto Domoticz which is on a Pi on the same network.

    Here is a the json format that Domoticz accepts:

    http://"Domoticz_IP":8080/json.htm?type=command&param=udevice&idx="IDX_of_TextSensor"&nvalue=0&svalue=Hello World
    

  • Mod

    I don't think it will be possible, because it is the gateway that handles the communication with the controller. Have you tried with V_CUSTOM type?



  • @gohan No I haven't, I'll give it a try. Thanks.


  • Mod

    @dpcr Remember the API page, you have plenty to play with 😄
    https://www.mysensors.org/download/serial_api_20#variable-types



  • The maximum payload size is 25 bytes!
    So there are some limitations.


  • Hero Member

    @dpcr You cannot ignore the character limit in MySensors by using a different V_ type. You either have to split the information in pieces that can be handled or have the controller do the handling for you.
    Also Domoticz uses the S_CUSTOM type in a very specific way.

    scripting in Domoticz is easy in Lua. What I would suggest is to build your tag 'database' in Domoticz (eg. a sensor for each tag) and handle logging from LUA.



  • @AWI Thanks for all your information, it gives me some direction. So from what I have read it sounds like MySensors can't send a json command to Domoticz.


Log in to reply
 

Suggested Topics

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

8
Online

11.4k
Users

11.1k
Topics

112.7k
Posts