#mqtt newbie starting configuration problem

1 messages · Page 1 of 1 (latest)

tribal spade
#

hi I am a new user to home-assistant, coming from iobroker.

#

I have a lot of mqtt devices, and unless iobroker, most of them are not recognized by ha.

#

i added the following in my configuration file :

#
mqtt: 
  sensor: !include_dir_merge_list mqtt/sensor/
  binary_sensor: !include_dir_merge_list mqtt/binary_sensor/
  switch: !include_dir_merge_list mqtt/switch/
  light: !include_dir_merge_list mqtt/light/
#

and in the folder mqtt/sensor, i added a file called Power_mqtt.yaml, with the following content :

#
- name: "Enovos_import_power_act"
  unique_id : enovos_act_power_consumption
  state_topic: "smartyreader_enovos/act_pwr_imported_p_plus"
  value_template: "{{ value_json.act_pwr_imported_p_plus_value }}"
  unit_of_measurement: "kW"
#

the data topic and data have been verifief by mqqt explorer and the payload of the topic smartyreader_enovos/act_pwr_imported_p_plus is

#
{"act_pwr_imported_p_plus_value":0.28,"act_pwr_imported_p_plus_unit":"kW"}
#

when checking the yaml configuration I get no errors, in the los , there are no errors. I switched on debugging in the mqtt integration, nothinh happens.

#

but the device/entitie is not present in my configuration. the topic has retain no, but tzhe device is sending a new payload every minute

viscid wolfBOT
#

@tribal spade To format your text as code, enter three backticks on the first line, press Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.

tribal spade
#

I can't figure out where the problem might be

plush ether
#

It'll be easier to help once you edit the post to use code markup for the YAML and payload

#

I'm unsure if Power_mqtt.yaml works, maybe try power_mqtt.yaml?

tribal spade
#

just changed Power_mqtt.yaml to power_mqtt.yaml, without any better result

#

am i right thinking that i do not need to enter ```
sensor:

  in every file in the mqtt/sensor folder ?
plush ether
#

Correct

#

Let me grab my own config

#
mqtt:
  sensor: !include_dir_merge_list mqtt/sensor/
  binary_sensor: !include_dir_merge_list mqtt/binary_sensor/
  device_tracker: !include_dir_merge_list mqtt/device_tracker/
``` <https://github.com/DubhAd/Home-AssistantConfig/blob/live/configuration.yaml#L51-L54>
```yaml
- name: "Zigbee2MQTT Version"
  unique_id: 'zigbee2mqtt_bridge_info_verson'
  state_topic: "zigbee2mqtt/bridge/info"
  value_template: "{{ value_json.version }}"
  icon: mdi:zigbee
``` <https://github.com/DubhAd/Home-AssistantConfig/blob/live/mqtt/sensor/zigbee/zigbee2mqtt_version.yaml>
#

The only thing I wonder about is that you have:

  unique_id : enovos_act_power_consumption
           ^
``` ❌