Sonoff POW R2 sensor values to mqtt

Tags: #<Tag:0x00007f32745e7010> #<Tag:0x00007f32745e6e08> #<Tag:0x00007f32745e6cc8>

Hi, I do have Sonoff POW R2 with Esphome that works well and I can see sensor cse7766 values (Voltage, current, power) in HA log. Here is code for getting values to HA:

  • platform: cse7766
    update_interval: 2s
    current:
    name: “Sonoff POW Current”
    id: current
    voltage:
    name: “Sonoff POW Voltage”
    id: voltage
    power:
    name: “Sonoff POW Power”
    id: power

I would like to send values to mqtt broker, but do not know what variable should I use to do that. Tried following syntax’s with no success:

mqtt:
broker: 192.168.1.29
username: *********
password: *********
on_message:
- topic: esp_pow1_Measures
payload: ‘Current’
then:
- mqtt.publish:
topic: esp_pow1_From
payload: current.value
- topic: esp_pow1_Measures
payload: ‘Voltage’
then:
- mqtt.publish:
topic: esp_pow1_From
payload: voltage
- topic: esp_pow1_Measures
payload: ‘Power’
then:
- mqtt.publish:
topic: esp_pow1_From
payload: Power.state

How can I send sensor readings over to mqtt broker?

Hi. I am trying to publish Sonoff Pow R2 measurements vs MQTT as well. Did you make any progress with this?