Joolee / nl.joolee.homey.espeasy

ESP Easy is a firmware for ESP8266 boards like the WeMos D1 and NodeMCU. It allows you to quickly make custom devices with switches, sensors and other hardware. This app adds support to Homey for connecting with ESP Easy units.
GNU General Public License v3.0
6 stars 5 forks source link

Blank screen when trying to add P004 Environment - DS18b20 #8

Closed Tequila329 closed 4 years ago

Tequila329 commented 4 years ago

Hi, I just get a blank screen with one button „finish“ wenn I try to add the temperature sensor via „environment“.

ESP and sensor is reachable and selectable, but after selecting, I click on next and after a few seconds I see the blank screen and the sensor will not be added.

Maybe any special setting at espeasy controller?

Joolee commented 4 years ago

Can you send the /json output of your ESP unit? If you also send in a crash report, I can see if the ESP is properly recognized.

Joolee commented 4 years ago

If It's the "SONOFF" sensor device listed in the other issue (can I close that one?), I probably fixed it in https://github.com/Joolee/nl.joolee.homey.espeasy/commit/90663c8496f362a3c29d67ba4d98c8291f8579ac

There is a double space in the identification string of that sensor and I copied it from the settings page. HTML filters out double spaces...

I'll upload it to the store (https://homey.app/a/nl.joolee.homey.espeasy/test/) but can you confirm this was the bug?

//Edit: I read now that you try to add the P004 device. I used a dummy of that one for testing so I'm pretty certain it will pair :) Don't know about the values though but I'm pretty confident there. Can you sent the /json and crashlog?

Tequila329 commented 4 years ago

I think this was my fault, i just checked that P004 is for Sonoff devices, i use the DS18b20 sensor with a NodeMCU + espeasy.

Joolee commented 4 years ago

So, does it work now? 😶

Tequila329 commented 4 years ago

With 1.3.1, unfortunately no :/ Down below is the JSON, the module it self reports the data to homey with system load, uptime etc.

{
   "System":{
      "Build":20105,
      "Git Build":"mega-20200328",
      "System Libraries":"ESP82xx Core 3d128e5c, NONOS SDK 2.2.2-dev(a58da79), LWIP: 2.1.2 PUYA support",
      "Plugin Count":46,
      "Plugin Description":"[Normal]",
      "Local Time":"2020-06-13 06:10:14",
      "Unit Number":0,
      "Unit Name":"Heizung_IoT",
      "Uptime":2015,
      "Last Boot Cause":"Manual reboot",
      "Reset Reason":"Software/System restart",
      "Load":9.80,
      "Load LC":3515,
      "CPU Eco Mode":"false",
      "Heap Max Free Block":15360,
      "Heap Fragmentation":5,
      "Free RAM":16080
   },
   "WiFi":{
      "Hostname":"Heizung-IoT",
      "IP Config":"Static",
      "IP Address":"192.168.151.4",
      "IP Subnet":"255.255.254.0",
      "Gateway":"192.168.150.1",
      "STA MAC":"50:02:91:E1:80:BA",
      "DNS 1":"192.168.150.10",
      "DNS 2":"(IP unset)",
      "SSID":"r-a-f_IoT",
      "BSSID":"9E:DA:C4:97:0E:52",
      "Channel":11,
      "Connected msec":20383841,
      "Last Disconnect Reason":201,
      "Last Disconnect Reason str":"(201) No AP found",
      "Number Reconnects":5,
      "Force WiFi B/G":"false",
      "Restart WiFi Lost Conn":"true",
      "Force WiFi No Sleep":"true",
      "Periodical send Gratuitous ARP":"false",
      "Connection Failure Threshold":0,
      "RSSI":-50
   },
   "Sensors":[
      {
         "TaskValues":[
            {
               "ValueNumber":1,
               "Name":"Temperature",
               "NrDecimals":2,
               "Value":"nan"
            },
            {
               "ValueNumber":2,
               "Name":"Humidity",
               "NrDecimals":2,
               "Value":"nan"
            }
         ],
         "DataAcquisition":[
            {
               "Controller":1,
               "IDX":0,
               "Enabled":"true"
            },
            {
               "Controller":2,
               "IDX":0,
               "Enabled":"false"
            },
            {
               "Controller":3,
               "IDX":0,
               "Enabled":"false"
            }
         ],
         "TaskInterval":60,
         "Type":"Environment - DHT11/12/22  SONOFF2301/7021",
         "TaskName":"Raumparameter",
         "TaskDeviceNumber":5,
         "TaskEnabled":"true",
         "TaskNumber":1
      },
      {
         "TaskValues":[
            {
               "ValueNumber":1,
               "Name":"Temperature",
               "NrDecimals":2,
               "Value":23.00
            }
         ],
         "DataAcquisition":[
            {
               "Controller":1,
               "IDX":0,
               "Enabled":"true"
            },
            {
               "Controller":2,
               "IDX":15,
               "Enabled":"true"
            },
            {
               "Controller":3,
               "IDX":0,
               "Enabled":"false"
            }
         ],
         "TaskInterval":15,
         "Type":"Environment - DS18b20",
         "TaskName":"Heizung_Vorlauf",
         "TaskDeviceNumber":4,
         "TaskEnabled":"true",
         "TaskNumber":2
      },
      {
         "TaskValues":[
            {
               "ValueNumber":1,
               "Name":"Analog",
               "NrDecimals":2,
               "Value":4.00
            }
         ],
         "DataAcquisition":[
            {
               "Controller":1,
               "IDX":0,
               "Enabled":"true"
            },
            {
               "Controller":2,
               "IDX":0,
               "Enabled":"false"
            },
            {
               "Controller":3,
               "IDX":0,
               "Enabled":"false"
            }
         ],
         "TaskInterval":5,
         "Type":"Analog input - internal",
         "TaskName":"Gas",
         "TaskDeviceNumber":2,
         "TaskEnabled":"true",
         "TaskNumber":3
      },
      {
         "DataAcquisition":[
            {
               "Controller":1,
               "IDX":0,
               "Enabled":"false"
            },
            {
               "Controller":2,
               "IDX":0,
               "Enabled":"false"
            },
            {
               "Controller":3,
               "IDX":0,
               "Enabled":"false"
            }
         ],
         "TaskInterval":0,
         "Type":"Display - OLED SSD1306/SH1106 Framed",
         "TaskName":"OLED",
         "TaskDeviceNumber":36,
         "TaskEnabled":"true",
         "TaskNumber":4
      },
      {
         "DataAcquisition":[
            {
               "Controller":1,
               "IDX":0,
               "Enabled":"false"
            },
            {
               "Controller":2,
               "IDX":0,
               "Enabled":"false"
            },
            {
               "Controller":3,
               "IDX":0,
               "Enabled":"false"
            }
         ],
         "TaskInterval":0,
         "Type":"Output - NeoPixel (Basic)",
         "TaskName":"LED",
         "TaskDeviceNumber":38,
         "TaskEnabled":"true",
         "TaskNumber":5
      }
   ],
   "TTL":5000
}
Tequila329 commented 4 years ago

Just a little bit of testing:

Edit: is it about the device setting --> when you tik the box to send to controller 1 and 2, it won't work. Only send to one controller is fine.

Joolee commented 4 years ago

Remember that you need to use a unique IDX value for the device with the Homey controller. For example;

The DS18b20 device in your /json list would be discovered because it has an enabled controller with a unique IDX that is not 0:

            {
               "Controller":2,
               "IDX":15,
               "Enabled":"true"
            },

The Sonoff device would not be found because the only enabled controller has a device IDX of 0:

            {
               "Controller":1,
               "IDX":0,
               "Enabled":"true"
            },

The order of your controllers should not matter.

Tequila329 commented 4 years ago

The order not, the issue that i send the values to two controllers is the "problem". For MQTT (Controller 1) there is no need to assign a IDX value.

Joolee commented 4 years ago

I can't reproduce that problem. My config is this:

sensors

Which results in:

"Sensors":[
   {
      "TaskValues":[
         {
            "ValueNumber":1,
            "Name":"uptime",
            "NrDecimals":2,
            "Value":214.00
         }
      ],
      "DataAcquisition":[
         {
            "Controller":1,
            "IDX":1,
            "Enabled":"false"
         },
         {
            "Controller":2,
            "IDX":0,
            "Enabled":"false"
         },
         {
            "Controller":3,
            "IDX":0,
            "Enabled":"false"
         }
      ],
      "TaskInterval":60,
      "Type":"Generic - System Info",
      "TaskName":"esp-heater",
      "TaskDeviceNumber":26,
      "TaskEnabled":"true",
      "TaskNumber":1
   },
   {
      "TaskValues":[
         {
            "ValueNumber":1,
            "Name":"State",
            "NrDecimals":0,
            "Value":0
         }
      ],
      "DataAcquisition":[
         {
            "Controller":1,
            "IDX":2,
            "Enabled":"false"
         },
         {
            "Controller":2,
            "IDX":2,
            "Enabled":"false"
         },
         {
            "Controller":3,
            "IDX":0,
            "Enabled":"false"
         }
      ],
      "TaskInterval":0,
      "Type":"Switch input - Switch",
      "TaskName":"test",
      "TaskDeviceNumber":1,
      "TaskEnabled":"true",
      "TaskNumber":2
   },
   {
      "TaskValues":[
         {
            "ValueNumber":1,
            "Name":"Temperature",
            "NrDecimals":2,
            "Value":"nan"
         },
         {
            "ValueNumber":2,
            "Name":"Humidity",
            "NrDecimals":2,
            "Value":"nan"
         }
      ],
      "DataAcquisition":[
         {
            "Controller":1,
            "IDX":1,
            "Enabled":"true"
         },
         {
            "Controller":2,
            "IDX":4,
            "Enabled":"true"
         },
         {
            "Controller":3,
            "IDX":0,
            "Enabled":"false"
         }
      ],
      "TaskInterval":60,
      "Type":"Environment - DHT11/12/22  SONOFF2301/7021",
      "TaskName":"sonoff",
      "TaskDeviceNumber":5,
      "TaskEnabled":"true",
      "TaskNumber":3
   },
   {
      "TaskValues":[
         {
            "ValueNumber":1,
            "Name":"Temperature",
            "NrDecimals":2,
            "Value":0.00
         }
      ],
      "DataAcquisition":[
         {
            "Controller":1,
            "IDX":0,
            "Enabled":"true"
         },
         {
            "Controller":2,
            "IDX":4,
            "Enabled":"true"
         },
         {
            "Controller":3,
            "IDX":0,
            "Enabled":"false"
         }
      ],
      "TaskInterval":60,
      "Type":"Environment - DS18b20",
      "TaskName":"DS18b20",
      "TaskDeviceNumber":4,
      "TaskEnabled":"true",
      "TaskNumber":4
   }
]

The first controller is a (bogey) "Domoticz MQTT" and the second one is Homey. I don't have any MQTT server running so I can't fully try that but the pairing wizard should only look at the /json response of your unit. Can you post it again with the configuration that is failing? Please also write which controller is which.

Tequila329 commented 4 years ago

This are my controllers (1 = MQTT, 2 = Homey) :

Bildschirmfoto 2020-06-16 um 13 47 12

With this settings, i get the circle and nothing happens:

Bildschirmfoto 2020-06-16 um 13 49 14 Bildschirmfoto 2020-06-16 um 13 49 43

With this setting, its working perfectly:

Bildschirmfoto 2020-06-16 um 13 50 51

When i enable the box for controller 1 after including, it is still working fine :) It is just about including.

P.S.: I can see at your setup, that you use a DHT22 sensor, too. Do you get both values available at Homey? I only get the temperature.

Joolee commented 4 years ago

I don't get any values from the DHT22 sensor because I don't have any 😅 The sensor is a dummy without anything connected so I can try pairing but I can't test out whether I get any values.

Can you send me a crash report and the /json output? I reproduced your setup here but everything is still working as expected...

Tequila329 commented 4 years ago

Ah ok :) No problem, just recognize the DHT22 at your screenshot.

Sure, here we go, JSON below and report ID is 05f4f81a-ce53-46ba-9546-1fe76964475b: This setup is working, for including the sensor, i have to disable the box with the MQTT controller within the sensor settings.

{
   "System":{
      "Build":20105,
      "Git Build":"mega-20200328",
      "System Libraries":"ESP82xx Core 3d128e5c, NONOS SDK 2.2.2-dev(a58da79), LWIP: 2.1.2 PUYA support",
      "Plugin Count":46,
      "Plugin Description":"[Normal]",
      "Local Time":"2020-06-18 05:51:21",
      "Unit Number":0,
      "Unit Name":"Heizung_IoT",
      "Uptime":2505,
      "Last Boot Cause":"Manual reboot",
      "Reset Reason":"Software/System restart",
      "Load":10.40,
      "Load LC":3501,
      "CPU Eco Mode":"false",
      "Heap Max Free Block":13624,
      "Heap Fragmentation":12,
      "Free RAM":15440
   },
   "WiFi":{
      "Hostname":"Heizung-IoT",
      "IP Config":"Static",
      "IP Address":"192.168.151.4",
      "IP Subnet":"255.255.254.0",
      "Gateway":"192.168.150.1",
      "STA MAC":"50:02:91:E1:80:BA",
      "DNS 1":"192.168.150.10",
      "DNS 2":"(IP unset)",
      "SSID":"r-a-f_IoT",
      "BSSID":"9E:DA:C4:97:0E:52",
      "Channel":11,
      "Connected msec":150317463,
      "Last Disconnect Reason":1,
      "Last Disconnect Reason str":"(1) Unspecified",
      "Number Reconnects":0,
      "Force WiFi B/G":"false",
      "Restart WiFi Lost Conn":"true",
      "Force WiFi No Sleep":"true",
      "Periodical send Gratuitous ARP":"false",
      "Connection Failure Threshold":0,
      "RSSI":-51
   },
   "Sensors":[
      {
         "TaskValues":[
            {
               "ValueNumber":1,
               "Name":"Temperature",
               "NrDecimals":2,
               "Value":23.20
            },
            {
               "ValueNumber":2,
               "Name":"Humidity",
               "NrDecimals":2,
               "Value":47.70
            }
         ],
         "DataAcquisition":[
            {
               "Controller":1,
               "IDX":0,
               "Enabled":"true"
            },
            {
               "Controller":2,
               "IDX":2,
               "Enabled":"true"
            },
            {
               "Controller":3,
               "IDX":0,
               "Enabled":"false"
            }
         ],
         "TaskInterval":30,
         "Type":"Environment - DHT11/12/22  SONOFF2301/7021",
         "TaskName":"Raumparameter",
         "TaskDeviceNumber":5,
         "TaskEnabled":"true",
         "TaskNumber":1
      },
      {
         "TaskValues":[
            {
               "ValueNumber":1,
               "Name":"Temperature",
               "NrDecimals":2,
               "Value":22.50
            }
         ],
         "DataAcquisition":[
            {
               "Controller":1,
               "IDX":0,
               "Enabled":"true"
            },
            {
               "Controller":2,
               "IDX":15,
               "Enabled":"true"
            },
            {
               "Controller":3,
               "IDX":0,
               "Enabled":"false"
            }
         ],
         "TaskInterval":15,
         "Type":"Environment - DS18b20",
         "TaskName":"Heizung_Vorlauf",
         "TaskDeviceNumber":4,
         "TaskEnabled":"true",
         "TaskNumber":2
      },
      {
         "TaskValues":[
            {
               "ValueNumber":1,
               "Name":"Analog",
               "NrDecimals":2,
               "Value":4.00
            }
         ],
         "DataAcquisition":[
            {
               "Controller":1,
               "IDX":0,
               "Enabled":"true"
            },
            {
               "Controller":2,
               "IDX":0,
               "Enabled":"false"
            },
            {
               "Controller":3,
               "IDX":0,
               "Enabled":"false"
            }
         ],
         "TaskInterval":5,
         "Type":"Analog input - internal",
         "TaskName":"Gas",
         "TaskDeviceNumber":2,
         "TaskEnabled":"true",
         "TaskNumber":3
      },
      {
         "DataAcquisition":[
            {
               "Controller":1,
               "IDX":0,
               "Enabled":"false"
            },
            {
               "Controller":2,
               "IDX":0,
               "Enabled":"false"
            },
            {
               "Controller":3,
               "IDX":0,
               "Enabled":"false"
            }
         ],
         "TaskInterval":0,
         "Type":"Display - OLED SSD1306/SH1106 Framed",
         "TaskName":"OLED",
         "TaskDeviceNumber":36,
         "TaskEnabled":"true",
         "TaskNumber":4
      },
      {
         "DataAcquisition":[
            {
               "Controller":1,
               "IDX":0,
               "Enabled":"false"
            },
            {
               "Controller":2,
               "IDX":0,
               "Enabled":"false"
            },
            {
               "Controller":3,
               "IDX":0,
               "Enabled":"false"
            }
         ],
         "TaskInterval":0,
         "Type":"Output - NeoPixel (Basic)",
         "TaskName":"LED",
         "TaskDeviceNumber":38,
         "TaskEnabled":"true",
         "TaskNumber":5
      }
   ],
   "TTL":5000
}
Joolee commented 4 years ago

I managed to fix the Humidity issue in 1.4.0 (in testing). Also did a lot of other bug fixes. I tried injecting your JSON directly into the app but I still couldn't reproduce the problem you're having adding environment devices. Was the json you posted from a state you were having problems with?

unnamed

Tequila329 commented 4 years ago

Thanks, the humidity is working well right now! :) The problem only exist when both controllers, MQTT and Homey are selected.

Yes the JSON was with the setting which fails. I see the screen you show above, but when i click on next, the inclusion only shows up with a blank screen or blank screen with circle.

Joolee commented 4 years ago

Finally fixed it :) Can you try again when I publish version 1.4.1? The warnings you'll get are about Controller #0, I'll try to make them more clear