Hi guys. I want to create a counter based on esp and PZEM-04. I want to read the indicators of my counter from the mqtt topic when starting esp. For this, I use the on_boot automation and the following code:
esphome:
name: esp_name
platform: ESP8266
board: nodemcuv2
on_boot:
priority: 600
then:
- mqtt.subscribe:
topic: "mqtt_topic"
mqtt:
broker: 'mqtt_server_ip'
username: 'mqtt_username'
password: 'mqtt_password'
sensor:
- platform: mqtt_subscribe
name: "Your Sensor"
state_topic: "mqtt_topic"
unit_of_measurement: "Your Unit of Measurement"
value_template: "{{ value }}"
but I get the error Unable to find action with the name ‘mqtt.subscribe’ Help to find a solution please