Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 106179

Problem with Tasmota & MQTT Switches & Sensors

$
0
0

Hi all,

I’ve bought a Gosund SP1 smart plug which has a Tasmota firmware.

I’ve set up MQTT on Home Assistant and did the proper configuration to both the tasmota software on the plug as well as to the Mosquito MQTT.

Devices can also communicate with each other. I’ve tested this within the MQTT Integration configuration by listening to the topics:

e.g.
tele/steckdose/waschmaschine/SENSOR returns

{
    "Time": "2020-09-26T07:47:08",
    "ENERGY": {
        "TotalStartTime": "2020-09-26T06:38:12",
        "Total": 0.1,
        "Yesterday": 0,
        "Today": 0.1,
        "Period": 0,
        "Power": 0,
        "ApparentPower": 0,
        "ReactivePower": 0,
        "Factor": 0,
        "Voltage": 0,
        "Current": 0
    }
}

or stat/steckdose/waschmaschine/RESULT returns

{
    "POWER": "ON"
}

I’ve now try to put the power plug as switch and sensor to my configuration.yaml like following:

switch:
  - platform: mqtt
    name: "Steckdose Waschmaschine"
    state_topic: "stat/steckdose/waschmaschine/RESULT"  
    value_template: "{{ value_json.POWER }}"
    command_topic: "cmnd/steckdose/waschmaschine/POWER"
    payload_on: "ON"
    payload_off: "OFF"
    availability_topic: "tele/steckdose/waschmaschine/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
    qos: 1
    retain: false

sensor:
  - platform: time_date
    display_options:
      - 'time'
      - 'date'
      - 'date_time'
      - 'date_time_utc'
      - 'date_time_iso'
      - 'time_date'
      - 'time_utc'
      - 'beat'
  - platform: mqtt
    name: "Energy Today"
    state_topic: "tele/steckdose/waschmaschine/SENSOR"
    value_template: '{{ value_json["ENERGY"]["Today"] }}'
    unit_of_measurement: "kWh"
  - platform: mqtt
    name: "Power"
    state_topic: "tele/steckdose/waschmaschine/SENSOR"
    value_template: '{{ value_json["ENERGY"]["Power"] }}'
    unit_of_measurement: "W"
  - platform: mqtt
    name: "Voltage"
    state_topic: "tele/steckdose/waschmaschine/SENSOR"
    value_template: '{{ value_json["ENERGY"]["Voltage"] }}'
    unit_of_measurement: "V"
  - platform: mqtt
    name: "Current"
    state_topic: "tele/steckdose/waschmaschine/SENSOR"
    value_template: '{{ value_json["ENERGY"]["Current"] }}'
    unit_of_measurement: "A"

My problems are:

  1. The switch works fine to switch the power plug on, but it cannot be switched off. The switch in the home assistant UI immediately gets back to off state after switching it on. I guess something is wrong with the state topic, but I cannot figure out what.
  2. The sensors are not appearing within home assistant

Does anybody has any advice?

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 106179

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>