Json via usb

Hi all,

I have json data coming from an arduino (moteino) connected to raspberry HA via USB. This json data has a format as follows: {“Temp2”:19.5,“Hum2”:53.9,“Temp3”:20.3,“Hum3”:52.1}.
I have configured HA as follows:

  • platform: serial
    serial_port: /dev/moteino
    baudrate: 115200
    name: H2
    value_template: ‘{{value_json.Hum2}}’
  • platform: serial
    serial_port: /dev/moteino
    baudrate: 115200
    name: T2
    value_template: ‘{{value_json.Temp2}}’
  • platform: serial
    serial_port: /dev/moteino
    baudrate: 115200
    name: T3
    value_template: ‘{{value_json.Temp3}}’
  • platform: serial
    serial_port: /dev/moteino
    baudrate: 115200
    name: H3
    value_template: ‘{{value_json.Hum3}}’

I get the four sensor circles at top of HA page, but only one contains the real number, while the other circles do not contain number (they say “unknown”). If I click on the good sensor circle, I can also read at the bottom of the small popup window all list of temp2, temp3, hum2, hum3 with correct numbers.
It looks that something is wrong in my configuration.
Is there anyone that understand what is the issue and how to solve?
Thanks a lot

Even though you have different names the serial platform is locking that one input to the first sensor defined. My guess if you dug in the logs is that the others would say something like resource not available or something. It’d be easy enough to split it out using something like a command line sensor that grabbed the values and input it via the rest api but there are probably other ways to do it

Similar problem.
I’ve got the JSON message arriving ok into my sensor.nano, but I cannot then extract the individual values into other entities.
Did you crack it?