NorthernMan54 / homebridge-tasmota

Plugin for Tasmota devices leveraging Home Assistant auto discovery
Apache License 2.0
35 stars 9 forks source link

ESP8266 - DHT11 issues #2

Closed StumbleNOLA closed 4 years ago

StumbleNOLA commented 4 years ago

Let me know if there is anything else I can provide to help trouble shoot.

Describe Your Problem: I am unable to get any sensor readings in Homebridge.

I have an ESP8266 NodeEMC attached to a DHT11 sensor. I did a clean install of Tasmota, got it on the Wifi network. Setup steps takes: ESP8266 -Config Module

Switched to HomeBride Config UI X

Logs:

[8/31/2020, 17:23:13] [Config] Homebridge restart request received
[8/31/2020, 17:23:13] [Config] UI / Bridge settings have not changed; only restarting Homebridge process
[8/31/2020, 17:23:13] [HB Supervisor] Sending SIGTERM to Homebridge
[8/31/2020, 17:23:13] Got SIGTERM, shutting down Homebridge...
[8/31/2020, 17:23:18] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[8/31/2020, 17:23:23] [HB Supervisor] Restarting Homebridge...
[8/31/2020, 17:23:23] [HB Supervisor] Starting Homebridge with extra flags: -I
[8/31/2020, 17:23:23] [HB Supervisor] Started Homebridge v1.1.2 with PID: 6258
[8/31/2020, 17:23:25] Loaded config.json with 3 accessories and 4 platforms.
[8/31/2020, 17:23:25] ---
[8/31/2020, 17:23:26] Loaded plugin: homebridge-bond@2.8.6
[8/31/2020, 17:23:26] Registering platform 'homebridge-bond.Bond'
[8/31/2020, 17:23:26] ---
[8/31/2020, 17:23:26] Loaded plugin: homebridge-config-ui-x@4.27.0
[8/31/2020, 17:23:26] Registering platform 'homebridge-config-ui-x.config'
[8/31/2020, 17:23:26] ---
[8/31/2020, 17:23:26] Loaded plugin: homebridge-magichome-dynamic-platform@1.3.10
[8/31/2020, 17:23:26] Registering platform 'homebridge-magichome-dynamic-platform.homebridge-magichome-dynamic-platform'
[8/31/2020, 17:23:26] ---
[8/31/2020, 17:23:26] Loaded plugin: homebridge-pihole@0.3.1
[8/31/2020, 17:23:26] Registering accessory 'homebridge-pihole.Pihole'
[8/31/2020, 17:23:26] ---
[8/31/2020, 17:23:26] Loaded plugin: homebridge-tasmota@0.0.17
[8/31/2020, 17:23:26] Registering platform 'homebridge-tasmota.Tasmota'
[8/31/2020, 17:23:26] ---
[8/31/2020, 17:23:26] Loaded plugin: homebridge-toggle-switch@0.1.0
[8/31/2020, 17:23:26] Registering accessory 'homebridge-toggle-switch.ToggleSwitch'
[8/31/2020, 17:23:26] ---
[8/31/2020, 17:23:26] Loading 4 platforms...
[8/31/2020, 17:23:26] [Config] Initializing config platform...
[8/31/2020, 17:23:26] [Config] Running in Service Mode
[8/31/2020, 17:23:26] [Bond] Initializing Bond platform...
[8/31/2020, 17:23:26] [homebridge-magichome-dynamic-platform] Initializing homebridge-magichome-dynamic-platform platform...
[8/31/2020, 17:23:26] [Tasmota] Initializing Tasmota platform...
[8/31/2020, 17:23:26] Loading 3 accessories...
[8/31/2020, 17:23:26] [POP Switch 1] Initializing ToggleSwitch accessory...
[8/31/2020, 17:23:27] [POP Switch 2] Initializing ToggleSwitch accessory...
[8/31/2020, 17:23:27] [POP Switch 3] Initializing ToggleSwitch accessory...
[8/31/2020, 17:23:27] [Tasmota] Loading accessory from cache: Temperature DHT11 Temperature
[8/31/2020, 17:23:27] [homebridge-magichome-dynamic-platform] Scanning broadcast-address: '10.0.0.255' on interface: 'eth0' for Magichome lights... 

Setup Payload:
X-HM://0024Q5TXX8BND
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

    ┌────────────┐     
    │ ###-##-### │     
    └────────────┘     

[8/31/2020, 17:23:27] Homebridge is running on port 51708.
[8/31/2020, 17:23:27] [POP Switch 1] Restoring persisted state: OFF
[8/31/2020, 17:23:27] [POP Switch 1] Setting switch to OFF.
[8/31/2020, 17:23:27] [Tasmota] Restoring existing service from cache: Temperature DHT11 Temperature
[8/31/2020, 17:23:27] [Tasmota] Restoring existing service from cache: Temperature DHT11 Humidity
[8/31/2020, 17:23:27] [Tasmota] Restoring existing service from cache: Temperature DHT11 DewPoint
[8/31/2020, 17:23:27] [Tasmota] Restoring existing service from cache: Temperature status
[8/31/2020, 17:23:27] [Bond] 3 cached accessories were loaded
[8/31/2020, 17:23:27] [Bond] Getting devices...
[8/31/2020, 17:23:27] [Bond] 3 devices were found on this Bond.
[8/31/2020, 17:23:27] [Bond] Attempting to add 0 devices that were not previously added.
[8/31/2020, 17:23:27] [Bond] Configuring Accessory: Living Room Ceiling fan
[8/31/2020, 17:23:27] [Bond] Configuring Accessory: Office Weee fan
[8/31/2020, 17:23:27] [Bond] Configuring Accessory: Guest Room Guest Fan
[8/31/2020, 17:23:29] [homebridge-magichome-dynamic-platform] 
Discovered 1 devices.

[8/31/2020, 17:23:29] [homebridge-magichome-dynamic-platform] 
Registering cached accessory 'Bed' 
Model: 'AK001-ZJ2101' 
Unique ID: '#########' 
IP-Address: '#.#.#.#' 
Version 8 
Version Modifier: 51

[8/31/2020, 17:23:29] [homebridge-magichome-dynamic-platform] 
Registered 1 Magichome device(s). 
New devices: 0 
Cached devices that were seen this restart: 1 
Cached devices that were not seen this restart: 0```

**Plugin Config:** (I assume the Status Report from the plugin)
{
  "Status": {
    "Module": 0,
    "DeviceName": "Tasmota",
    "FriendlyName": [
      "Tasmota"
    ],
    "Topic": "tasmota_2FF9EA",
    "ButtonTopic": "0",
    "Power": 0,
    "PowerOnState": 3,
    "LedState": 1,
    "LedMask": "FFFF",
    "SaveData": 1,
    "SaveState": 1,
    "SwitchTopic": "0",
    "SwitchMode": [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    "ButtonRetain": 0,
    "SwitchRetain": 0,
    "SensorRetain": 0,
    "PowerRetain": 0
  },
  "StatusPRM": {
    "Baudrate": 115200,
    "SerialConfig": "8N1",
    "GroupTopic": "tasmotas",
    "OtaUrl": "http://thehackbox.org/tasmota/release/tasmota.bin",
    "RestartReason": "Software/System restart",
    "Uptime": "0T00:08:51",
    "StartupUTC": "2020-08-31T16:06:08",
    "Sleep": 50,
    "CfgHolder": 4617,
    "BootCount": 4,
    "BCResetTime": "2020-08-31T17:03:55",
    "SaveCount": 12,
    "SaveAddress": "F8000"
  },
  "StatusFWR": {
    "Version": "8.4.0(tasmota)",
    "BuildDateTime": "2020-07-29T12:05:28",
    "Boot": 31,
    "Core": "2_7_2_1",
    "SDK": "2.2.2-dev(38a443e)",
    "CpuFrequency": 80,
    "Hardware": "ESP8266EX",
    "CR": "365/699"
  },
  "StatusLOG": {
    "SerialLog": 2,
    "WebLog": 2,
    "MqttLog": 0,
    "SysLog": 0,
    "LogHost": "",
    "LogPort": 514,
    "SSId": [
      "#######",
      ""
    ],
    "TelePeriod": 300,
    "Resolution": "558180C0",
    "SetOption": [
      "00008009",
      "2805C8000100060000005A00000000000000",
      "00800000",
      "00006000"
    ]
  },
  "StatusMEM": {
    "ProgramSize": 592,
    "Free": 408,
    "Heap": 25,
    "ProgramFlashSize": 4096,
    "FlashSize": 4096,
    "FlashChipId": "16405E",
    "FlashFrequency": 40,
    "FlashMode": 0,
    "Features": [
      "00000809",
      "8FDAE797",
      "04368001",
      "000000CD",
      "010013C0",
      "C000F981",
      "00004004"
    ],
    "Drivers": "1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,27,29,30,35,37",
    "Sensors": "1,2,3,4,5,6"
  },
  "StatusNET": {
    "Hostname": "tasmota_2FF9EA-6634",
    "IPAddress": "#.#.#.#",  "Ed: This is confirmed as the same at the device is at"
    "Gateway": "10.0.0.1",
    "Subnetmask": "255.255.255.0",
    "DNSServer": "#.#.#.#",
    "Mac": "##:##:##:##:##:##",
    "Webserver": 2,
    "WifiConfig": 4,
    "WifiPower": 17
  },
  "StatusMQT": {
    "MqttHost": "",
    "MqttPort": 1883,
    "MqttClientMask": "DVES_%06X",
    "MqttClient": "DVES_2FF9EA",
    "MqttUser": "DVES_USER",
    "MqttCount": 0,
    "MAX_PACKET_SIZE": 1200,
    "KEEPALIVE": 30
  },
  "StatusTIM": {
    "UTC": "2020-08-31T16:14:59",
    "Local": "2020-08-31T17:14:59",
    "StartDST": "2020-03-29T02:00:00",
    "EndDST": "2020-10-25T03:00:00",
    "Timezone": "+01:00",
    "Sunrise": "06:06",
    "Sunset": "19:33"
  },
  "StatusSNS": {
    "Time": "2020-08-31T17:14:59",
    "DHT11": {
      "Temperature": 26.1,
      "Humidity": 49,
      "DewPoint": 14.5
    },
    "TempUnit": "C"
  },
  "StatusSTS": {
    "Time": "2020-08-31T17:14:59",
    "Uptime": "0T00:08:51",
    "UptimeSec": 531,
    "Heap": 25,
    "SleepMode": "Dynamic",
    "Sleep": 50,
    "LoadAvg": 19,
    "MqttCount": 0,
    "Wifi": {
      "AP": 1,
      "SSId": "####",
      "BSSId": "####,
      "Channel": 8,
      "RSSI": 74,
      "Signal": -63,
      "LinkCount": 1,
      "Downtime": "0T00:00:06"
    }
  }
}

```json
 {
            "name": "Tasmota",
            "mqttHost": "#.#.#.#",
            "cleanup": 24,
            "debug": false,
            "platform": "Tasmota"
        }

Environment:

NorthernMan54 commented 4 years ago

The Issue template is still the default one, I need to clean It up

You should have a new tile "Temperature DHT11 Temperature" which has several sub tiles

[8/31/2020, 17:23:27] [Tasmota] Restoring existing service from cache: Temperature DHT11 Temperature [8/31/2020, 17:23:27] [Tasmota] Restoring existing service from cache: Temperature DHT11 Humidity [8/31/2020, 17:23:27] [Tasmota] Restoring existing service from cache: Temperature DHT11 DewPoint

If you enable DEBUG, it will include more detail

It will take about 5 minutes for the first update to appear ( Teleperiod ) then it will update every 5 minutes

StumbleNOLA commented 4 years ago

In the Home app I have a tile "Temperature" with 2 sensors "Humidity Sensor" and "Temperature." In the Homebridge Accessories tab of the Homebridge UI I have two separate tiles. 1) "Temperature DHT Temperature" and 2) "Temperature DHT11 Humidity"

Dewpoint doesn't show up in either of them (Note I don't care that much about dew point though).

I just enabled "Debug Logging" I will report back in 10 minutes. Where are the logs located?

StumbleNOLA commented 4 years ago

So I just noticed I DID NOT set AutoDiscovery from the console on redoing the setup. I am not sure if anything above this is particularly valuable now.

I have gone ahead and set it via SetOption19 1 on the Tasmota device's terminal. Then restarted both the device and Homebridge.

Edit: I just noticed that there is not an accessory set up by the plugin in the Homebridge-Config. It only creates an instance under platforms. Is this working as intended?

NorthernMan54 commented 4 years ago

And success?

PS Dewpoint is not a support characteristic in the home app, so it won’t appear

StumbleNOLA commented 4 years ago

Nope. I get the same thing. The temp and humidity readings are still zero.

I doubt it, but is there any chance that the fact I have my Pi's Wifi off could be an issue? I have it hardwired to a switch, so internet isn't an issue.

StumbleNOLA commented 4 years ago

Solved..... But I have absolutely no idea what I did differently. I went thru a step by step process, and logged every mouse click. I am not sure where the difference is, but in case it helps someone else in the future or more likely myself when trying to do it again...

Step Log (Everything was done in this order, nothing not logged was done)

  1. Uninstalled all MQTT plugins, reflashed the ESP8266 (NodeMCU by PyFlasher - Dual I/O (DIO) - Wpe all data), rebooted Homebridge
  2. Rebooted ESP
  3. Connected it to wifi network
  4. Installed Homebridge Tasmota by @Northernman with Plugins tab in homebridge
  5. From ESP-Tasmota webUI
    1. Toggle on
    2. Configuration
      1. Configure module
        1. Sonoff Basic (1)
        2. GPIO14 Sensor: DHT11(1)
        3. Save
      2. Configure MQTT
        1. Host: 10.0.0.11
        2. Save
      3. Terminal
        1. Set to discoverable via SetOption19 1
    3. Notes: Data is showing properly in the WebUI
  6. Using MQTT Explorer to monitor MQTT data stream
    1. 10.0.0.11 now shows
      1. tele
        1. tasmota_2FF9EA
          1. A bunch of data that wasn’t there before hand. Including the sensor data correctly
  7. Homebridge Tasmota Settings:
    1. Name: Tasmota (default)
    2. MQTT Host Address: 10.0.0.11 ZZ(Should http or MQTT be here?)
    3. Debug logging enabled
    4. Save
    5. Restarted Homebridge

Known differences: 1) Sonof Basic instead of Generic

NorthernMan54 commented 4 years ago

Very glad to hear that you got everything going, your next device should be a lot easier.

And thanks for sharing the steps you followed

NorthernMan54 commented 4 years ago

@StumbleNOLA I just discovered a painful bug, the auto clean up of disconnected devices was a bit aggressive and cleaning up all devices after 24 hours, please update to the latest.