Grouping of multiple MQTT sensors

Hi,
I am trying to set the HA as MQTT data collector, logger, and controller. This should be typical use for HA.
I configured 3 sensors which receive data from power meter:

sensor:
  - platform: mqtt
    state_topic: "shm/hub/power/main/phase/0"
    name: "Power phase 0"
    unit_of_measurement: 'mA'
  - platform: mqtt
    state_topic: "shm/hub/power/main/phase/1"
    name: "Power phase 1"
    unit_of_measurement: 'mA'
  - platform: mqtt
    state_topic: "shm/hub/power/main/phase/2"
    name: "Power phase 2"
    unit_of_measurement: 'mA'

group:
  power_sensor:
    name: Power monitor
    entities:
      - sensor.power_phase_0
      - sensor.power_phase_1
      - sensor.power_phase_2

Tested with mosquitto_sub on the Raspberry which is running HA and the MQTT data arrives OK:

shm/hub/power/main/phase/2 1142
shm/hub/power/main/phase/1 140
shm/hub/power/main/phase/0 643

The error I get when starting HA is:

2018-02-03 15:15:57 ERROR (Thread-2) [homeassistant.util.yaml] mapping values are not allowed here
  in "/home/pi/.homeassistant/configuration.yaml", line 107, column 15
2018-02-03 15:15:57 ERROR (MainThread) [homeassistant.bootstrap] Error loading 
/home/pi/.homeassistant/configuration.yaml: mapping values are not allowed here
  in "/home/pi/.homeassistant/configuration.yaml", line 107, column 15

Tried to follow:

Advice appreciated.

Have you made sure it’s spaces not tabs at the start of the lines?

Sure, spaces.
Trying to sort out the post formatting…

It seems I am missing some conceptual points of HA. Maybe “customizing” should come in the middle between sensors and groups? Or something else?

The error you’re receiving is a formatting error. What’s on line 107 of your config?

Kill me if I know :slight_smile:
it was:

  power_sensor:

Restarted the HA service again and the grouping is accepted.
No idea what was the problem, it disappeared magically…

What mains meter are you using? I am looking into them and am curious.

In this particular case I built my own “meter” with simple coils + ADS1115. Calibrated it for correct current measure and ignore the AC voltage, power phase shifts, power quality, etc. I.e. not recommended for wide use :slight_smile:

Probably, easy and more reliable way to measure power is using the same chip as Sonoff POW uses.

I would like to monitor the voltage as well. But I really want to look at the entire load on my house. Thanks, wish the POW would go that high… I would find a way to attach coils to it and move on.

Iotawatt is easy to set up… can monitor 14 different feeds using CTs, monitoring voltage as well. I am using a RPi 3B+ as my emoncms server and use the emoncms sensor for HA. It’s fairly cheap as well. https://stuff.iotawatt.com