Sonoff Basic Expansion Mod - Capacitive Buttons, PIR Motion Sensors, Tasmota Firmware Rules and more!

The Sonoff Hydra-Basic with two capacitive touch buttons and a PIR motion sensor. Video tutorial of how it is created and setup with Tasmota firmware. Let me know what you guys/gals think as I plan to do more Tasmota based tutorials.

5 Likes

Hi,
I have enjoyed/been inspired by your videos – so thanks for sharing.

I have implemented a ESP8266 with Tasmota + BME680, have it streaming MQTT to my HA instance. Sensor shows up in HA, but data says “Unavailable” so I believe my template is incorrect, but I cannot figure it out. Below is sample. I have tried single and double quotes, or removed trying value_json.BME6800.Temperature, but to no avail. Can anyone quide me?

#  tele/NodeMCU1/SENSOR = {"Time":"2018-12-03T10:42:27","BME680":{"Temperature":23.8,"Humidity":55.0,"Pressure":950.7,"Gas":104.10},"TempUnit":"C"}
   - platform: mqtt
    name: "MCU1 Temperature"
    state_topic: "tele/NodeMCU1/SENSOR"
    value_template: "{{ value_json.["BME680"].Temperature }}"
    unit_of_measurement: "°C"
    availability_topic: "tele/NodeMCU1/SENSOR"
    payload_available: "Online"
    payload_not_available: "Offline"
  - platform: mqtt
    name: "MCU1 Humidity"
    state_topic: "tele/NodeMCU1/SENSOR"
    value_template: "{{ value_json.["BME680"].Humidity }}"
    unit_of_measurement: "%"
    availability_topic: "tele/NodeMCU1/SENSOR"
    payload_available: "Online"
    payload_not_available: "Offline"

Thanks in Advance,
~Bryan

this is a copy and paste of my code from my loft sensor.

- platform: mqtt
  name: "Loft Temperature"
  state_topic: "tele/extractorfan/SENSOR"
  value_template: "{{ value_json['AM2301'].Temperature }}"
  unit_of_measurement: "°C"
  retain: true
- platform: mqtt
  name: "Loft Humidity"
  device_class: "humidity"
  state_topic: "tele/extractorfan/SENSOR"
  value_template: "{{ value_json['AM2301'].Humidity }}"
  unit_of_measurement: "%"
  retain: true

So give these a try,

  value_template: "{{ value_json['BME680'].Temperature }}"

and

  value_template: "{{ value_json['BME680'].Humidity }}"

Hi,

Thank you for the guidance in the right direction.

After a little more troubleshooting, I have found that I had an extra period right after value_json, which was at fault.

SOLVED and Working.

  - platform: mqtt
    name: "MCU1 Temperature"
    state_topic: "tele/NodeMCU1/SENSOR"
    unit_of_measurement: "°C"
    value_template: "{{ value_json['BME680'].Temperature }}"
    availability_topic: "tele/NodeMCU1/SENSOR"
    payload_available: "Online"
    payload_not_available: "Offline"
 - platform: mqtt
    name: "MCU1 Humidity"
    state_topic: "tele/NodeMCU1/SENSOR"
    value_template: "{{ value_json['BME680'].Humidity }}"
    unit_of_measurement: "%"
    availability_topic: "tele/NodeMCU1/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
  - platform: mqtt
    name: "MCU1 Pressure"
    state_topic: "tele/NodeMCU1/SENSOR"
    value_template: "{{ value_json['BME680'].Pressure }}"
    unit_of_measurement: "hPA"
    availability_topic: "tele/NodeMCU1/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
  - platform: mqtt
    name: "MCU1 Gas"
    state_topic: "tele/NodeMCU1/SENSOR"
    value_template: "{{ value_json['BME680'].Gas }}"
    unit_of_measurement: ""
    availability_topic: "tele/NodeMCU1/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"

Your availability topic is incorrect. It should end in LWT.

Thank you – my bad – will edit above.

Hello @digiblur will you help. what i’m trying to do is
1… unlink PIR which is connected to GPIO14 with relay
2… PIR should only send MQTT if sonoff basic is connected to mqtt broker and do nothing when mqtt is not connected
3… sonoff can’t be restarted in rules because i have PowerOnState 1 (which will turn on relay)