AlexxIT / SonoffLAN

Control Sonoff Devices with eWeLink (original) firmware over LAN and/or Cloud from Home Assistant

Home Page:https://github.com/AlexxIT/Blog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Refresh interval

bquemero opened this issue · comments

Maxx, thank you very much for your custom component. It works very well for me. How can I set the refresh time of the attributes as power or current of my POWR2?

Thanks Maxx very good integration before using the ewelink cloud and now it is much better. The update time of the POW2 can be adjusted.

Alex, not Maxx 😄
Devices themselves send updates in this version of the component.

Alex, not Maxx 😄
Devices themselves send updates in this version of the component.

Thanks Alex !!!!

Alex, not Maxx 😄
Devices themselves send updates in this version of the component.

Lol at Maxx :) . Any Idea why my devices not sending updates except once per reboot? (I'm using a shared account credentials)

@elserge82 are there any errors in the logs?

2020-02-18 11:15:31 DEBUG (SyncWorker_18) [custom_components.sonoff] {"seq":3,"sequence":"1582017331","error":0}

Several with different syncworker, sq and sequence values.
Same error value 0

@elserge82 what is your version of home assistant?

@elserge82 what is your version of home assistant?

105.3

@elserge82 have you something like this in logs?

2020-02-18 18:39:35 DEBUG (zeroconf-ServiceBrowser_eWeLink_1000123456._ewelink._tcp.local.) [custom_components.sonoff] Update service eWeLink_1000123456._ewelink._tcp.local.

2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085fbfb._ewelink._tcp.local.) [custom_components.sonoff] Update service eWeLink_100085fbfb._ewelink._tcp.local. 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085fbfb._ewelink._tcp.local.) [custom_components.sonoff] Update service eWeLink_100085fbfb._ewelink._tcp.local. 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085fbfb._ewelink._tcp.local.) [custom_components.sonoff] Properties: {'txtvers': '1', 'id': '100085fbfb', 'type': 'strip', 'apivers': '1', 'seq': '1', 'encrypt': True, 'iv': 'Mzg1OTU4MzI5MzczMjY4OA==', 'data1': 'UBPWhA6ahtSzEZotGGYVOnA4qF0QlIJmG3HnbVifXkvaAUlN4e/3EIWe2A0y5EYCjMDYu3iKyNtvR5vCzZrfsPulDuLcpk2PfKTj2eoF2C2a5l4iE3AfVpmlK+irDfZYt2/eZomsNHP054Bp51fnc//WLbMeBFbOa7Npk0XM+25vol6qUinKIGBP1aPoxdsnAF010WQFVWcw5y7PuhKh91l/C7mn5ElB8yBbLGPmsz+lQ28KCPphUzyx+', 'data2': 'NaYmAsNaC/QSNKpnRfAykaAkE9YewEdPUlRrZgHVJeuuiyRpQ5dcYW1hdX7OLYPWSeeUrfzQHG8Nx4ozqX2MM6J7tJZirrKup/dpmvnSB9HqvHagFAHaTJATy//9JdZHSi86PAf649eb96uSIqqTA3SQ1y46oOsx3dN8/kq9F6e3BL2mTUMJGTR3ZvgIKyaLOUm0lQOXFBQw/BW4mqMb20j3lKHUe9b7MnA2gBt1HUtiyaJ7WZKTufbnx', 'data3': 'wl4ZgfQ1Gy0298TRwnZrA6Lwd+BpQAz3RvP5Aravx4Xaai89BSYO8JoRuPNhcw0sTCmlr7d9Et6u/kWi88xFyhK7BSVMThCXr/iFtO6/UiC4+MQAzdjqAk0iU='} 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085fbfb._ewelink._tcp.local.) [custom_components.sonoff] Properties: {'txtvers': '1', 'id': '100085fbfb', 'type': 'strip', 'apivers': '1', 'seq': '1', 'encrypt': True, 'iv': 'Mzg1OTU4MzI5MzczMjY4OA==', 'data1': 'UBPWhA6ahtSzEZotGGYVOnA4qF0QlIJmG3HnbVifXkvaAUlN4e/3EIWe2A0y5EYCjMDYu3iKyNtvR5vCzZrfsPulDuLcpk2PfKTj2eoF2C2a5l4iE3AfVpmlK+irDfZYt2/eZomsNHP054Bp51fnc//WLbMeBFbOa7Npk0XM+25vol6qUinKIGBP1aPoxdsnAF010WQFVWcw5y7PuhKh91l/C7mn5ElB8yBbLGPmsz+lQ28KCPphUzyx+', 'data2': 'NaYmAsNaC/QSNKpnRfAykaAkE9YewEdPUlRrZgHVJeuuiyRpQ5dcYW1hdX7OLYPWSeeUrfzQHG8Nx4ozqX2MM6J7tJZirrKup/dpmvnSB9HqvHagFAHaTJATy//9JdZHSi86PAf649eb96uSIqqTA3SQ1y46oOsx3dN8/kq9F6e3BL2mTUMJGTR3ZvgIKyaLOUm0lQOXFBQw/BW4mqMb20j3lKHUe9b7MnA2gBt1HUtiyaJ7WZKTufbnx', 'data3': 'wl4ZgfQ1Gy0298TRwnZrA6Lwd+BpQAz3RvP5Aravx4Xaai89BSYO8JoRuPNhcw0sTCmlr7d9Et6u/kWi88xFyhK7BSVMThCXr/iFtO6/UiC4+MQAzdjqAk0iU='} 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser__ewelink._tcp.local.) [custom_components.sonoff] Add service eWeLink_1000739128._ewelink._tcp.local. 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085fbfb._ewelink._tcp.local.) [custom_components.sonoff] State: {'sledOnline': 'on', 'configure': [{'startup': 'stay', 'outlet': 0}, {'startup': 'stay', 'outlet': 1}, {'startup': 'stay', 'outlet': 2}, {'startup': 'off', 'outlet': 3}], 'pulses': [{'pulse': 'off', 'width': 1000, 'outlet': 0}, {'pulse': 'off', 'width': 1000, 'outlet': 1}, {'pulse': 'off', 'width': 1000, 'outlet': 2}, {'pulse': 'off', 'width': 1000, 'outlet': 3}], 'switches': [{'switch': 'off', 'outlet': 0}, {'switch': 'off', 'outlet': 1}, {'switch': 'off', 'outlet': 2}, {'switch': 'off', 'outlet': 3}]} 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085aeb9._ewelink._tcp.local.) [custom_components.sonoff] Update service eWeLink_100085aeb9._ewelink._tcp.local. 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085aeb9._ewelink._tcp.local.) [custom_components.sonoff] Update service eWeLink_100085aeb9._ewelink._tcp.local. 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085aeb9._ewelink._tcp.local.) [custom_components.sonoff] Properties: {'txtvers': '1', 'id': '100085aeb9', 'type': 'strip', 'apivers': '1', 'seq': '3', 'encrypt': True, 'iv': 'MDIzOTY5NjAyODg5MDYzMQ==', 'data1': 'b4wgPVR0zwU6OKcHrgsfgQhuLykCQv9DY6J802Z91L2buU472jvsrQGVDYPghnTHFf2V4Lm0g0KcN+YoEyYDVbFp+hXz6+yDW5YX5paXtP47aKuyGr5XLILiTCUYbArwvRDlBpmPzkrAztCJeL3si63kTlcw2E5RxxJDiYQCjERupZszNSICqddLXvO/ggbTYxr3hGpSgzjmfQ2MF+llMHSSTpP4MojkMHwwYxNGjbvQQ7Dkad1JPftkN', 'data2': 'RwdrqxCWCUOKygEatseTcWPllWnBv0tSjkrl/c0Dqk2MN+i4Bze6iQzXufKWNIjCl3Yz82yVXcESzoZq/YJ2z6ye3RVvwhE3SiHPF0RaGa+qQBI1FoDXl7Iq0i1hROQxVwyFtaH1rqOD0l4/5omGlOmeX7lfqqzeNoyAQGwThvb2JpKVWCuMGp5U7s66O0mFa3T43FNByKtbV44zqiWEoZ6Nmshcnw/5GtaYdsqG+/DsRWcoptrtpPiBG', 'data3': '1GcLgKcfp5fCXl02H7GSCCZ4XdhAGAOHe35LDVqVnzyWrrxpHOVhhJh9JWyNWi7V2Uo7pIntnZmSXtMmffnDN5MDlggN9KID+ElWL/r2H3Sip/KSh+mY0DplA='} 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085aeb9._ewelink._tcp.local.) [custom_components.sonoff] Update service eWeLink_100085aeb9._ewelink._tcp.local. 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085aeb9._ewelink._tcp.local.) [custom_components.sonoff] Properties: {'txtvers': '1', 'id': '100085aeb9', 'type': 'strip', 'apivers': '1', 'seq': '3', 'encrypt': True, 'iv': 'MDIzOTY5NjAyODg5MDYzMQ==', 'data1': 'b4wgPVR0zwU6OKcHrgsfgQhuLykCQv9DY6J802Z91L2buU472jvsrQGVDYPghnTHFf2V4Lm0g0KcN+YoEyYDVbFp+hXz6+yDW5YX5paXtP47aKuyGr5XLILiTCUYbArwvRDlBpmPzkrAztCJeL3si63kTlcw2E5RxxJDiYQCjERupZszNSICqddLXvO/ggbTYxr3hGpSgzjmfQ2MF+llMHSSTpP4MojkMHwwYxNGjbvQQ7Dkad1JPftkN', 'data2': 'RwdrqxCWCUOKygEatseTcWPllWnBv0tSjkrl/c0Dqk2MN+i4Bze6iQzXufKWNIjCl3Yz82yVXcESzoZq/YJ2z6ye3RVvwhE3SiHPF0RaGa+qQBI1FoDXl7Iq0i1hROQxVwyFtaH1rqOD0l4/5omGlOmeX7lfqqzeNoyAQGwThvb2JpKVWCuMGp5U7s66O0mFa3T43FNByKtbV44zqiWEoZ6Nmshcnw/5GtaYdsqG+/DsRWcoptrtpPiBG', 'data3': '1GcLgKcfp5fCXl02H7GSCCZ4XdhAGAOHe35LDVqVnzyWrrxpHOVhhJh9JWyNWi7V2Uo7pIntnZmSXtMmffnDN5MDlggN9KID+ElWL/r2H3Sip/KSh+mY0DplA='} 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085aeb9._ewelink._tcp.local.) [custom_components.sonoff] Properties: {'txtvers': '1', 'id': '100085aeb9', 'type': 'strip', 'apivers': '1', 'seq': '3', 'encrypt': True, 'iv': 'MDIzOTY5NjAyODg5MDYzMQ==', 'data1': 'b4wgPVR0zwU6OKcHrgsfgQhuLykCQv9DY6J802Z91L2buU472jvsrQGVDYPghnTHFf2V4Lm0g0KcN+YoEyYDVbFp+hXz6+yDW5YX5paXtP47aKuyGr5XLILiTCUYbArwvRDlBpmPzkrAztCJeL3si63kTlcw2E5RxxJDiYQCjERupZszNSICqddLXvO/ggbTYxr3hGpSgzjmfQ2MF+llMHSSTpP4MojkMHwwYxNGjbvQQ7Dkad1JPftkN', 'data2': 'RwdrqxCWCUOKygEatseTcWPllWnBv0tSjkrl/c0Dqk2MN+i4Bze6iQzXufKWNIjCl3Yz82yVXcESzoZq/YJ2z6ye3RVvwhE3SiHPF0RaGa+qQBI1FoDXl7Iq0i1hROQxVwyFtaH1rqOD0l4/5omGlOmeX7lfqqzeNoyAQGwThvb2JpKVWCuMGp5U7s66O0mFa3T43FNByKtbV44zqiWEoZ6Nmshcnw/5GtaYdsqG+/DsRWcoptrtpPiBG', 'data3': '1GcLgKcfp5fCXl02H7GSCCZ4XdhAGAOHe35LDVqVnzyWrrxpHOVhhJh9JWyNWi7V2Uo7pIntnZmSXtMmffnDN5MDlggN9KID+ElWL/r2H3Sip/KSh+mY0DplA='} 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085aeb9._ewelink._tcp.local.) [custom_components.sonoff] State: {'sledOnline': 'on', 'configure': [{'startup': 'stay', 'outlet': 0}, {'startup': 'stay', 'outlet': 1}, {'startup': 'stay', 'outlet': 2}, {'startup': 'off', 'outlet': 3}], 'pulses': [{'pulse': 'off', 'width': 1000, 'outlet': 0}, {'pulse': 'off', 'width': 1000, 'outlet': 1}, {'pulse': 'off', 'width': 1000, 'outlet': 2}, {'pulse': 'off', 'width': 1000, 'outlet': 3}], 'switches': [{'switch': 'off', 'outlet': 0}, {'switch': 'off', 'outlet': 1}, {'switch': 'off', 'outlet': 2}, {'switch': 'off', 'outlet': 3}]} 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser__ewelink._tcp.local.) [custom_components.sonoff] Properties: {'txtvers': '1', 'id': '1000739128', 'type': 'strip', 'apivers': '1', 'seq': '3', 'encrypt': True, 'iv': 'ODY0OTQ0Mjk2MTkyNzc0MQ==', 'data1': 'CwjepbxtxkCIkpzLNIlaba6veDMrbdCGITgMdk2k9ESWiqrOSsKsjcK60oWFr4WhinRT0MaN0VWTlzkklVWcTmVbGEkN/qB/fX12WXTvPYZQGQaUOXqsL7ddXwT5Zi/Y3HavfKoVC7aZQMhVeeesjW/0tOlaa9y/9w2h5IB0fG/m6a6BVpcTeEq/JvMhKLz4slspRLVNQGk/dfM0b1YZfHClZohzXKt5PuuXp884DX51w4ap4210ZuW/p', 'data2': '7Vf+1BCV0iLfQ1s4nDfCnHwpihiYc5RdASWcdUrIgwi7iIT9TtSvorA1R80p07RtMqgTf3TMDyoe8bbPYymJIqWoK0/LU0UaimbR2sHQNrBv6bUYGFvnxkFVYKvtXszW40Az/1p12m3SNInaHTv0iT67AevhMOJixLyhmKYF552DjzYKZxz99Fv8GaqVNafbuHtpezXmRf823fNNtiw/r8ZcMh8DaBvlPk6zVhmP18j1CRcg8xl/YJC5R', 'data3': '59qtkGcLLxTJ1VMn9Hb2uHWaaNXvgfsIk8Xdae6I31DOqjwbJ51V/sXgG4vLe8NysvqsoUnzutt9TwzseZNm+Pg0X8cBRcCepYrw=='} 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser__ewelink._tcp.local.) [custom_components.sonoff] State: {'sledOnline': 'on', 'configure': [{'startup': 'off', 'outlet': 0}, {'startup': 'off', 'outlet': 1}, {'startup': 'off', 'outlet': 2}, {'startup': 'off', 'outlet': 3}], 'pulses': [{'pulse': 'off', 'width': 1000, 'outlet': 0}, {'pulse': 'off', 'width': 1000, 'outlet': 1}, {'pulse': 'off', 'width': 1000, 'outlet': 2}, {'pulse': 'off', 'width': 1000, 'outlet': 3}], 'switches': [{'switch': 'off', 'outlet': 0}, {'switch': 'off', 'outlet': 1}, {'switch': 'off', 'outlet': 2}, {'switch': 'off', 'outlet': 3}]} 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085a8df._ewelink._tcp.local.) [custom_components.sonoff] Update service eWeLink_100085a8df._ewelink._tcp.local. 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085a8df._ewelink._tcp.local.) [custom_components.sonoff] Update service eWeLink_100085a8df._ewelink._tcp.local. 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085a8df._ewelink._tcp.local.) [custom_components.sonoff] Properties: {'txtvers': '1', 'id': '100085a8df', 'type': 'strip', 'apivers': '1', 'seq': '1', 'encrypt': True, 'iv': 'NjAyNDU5NDQxOTM1NjY3Nw==', 'data1': 'pPZoYSDkkRC9Tg6rLX/qhHKS//U5jrzLeWJiWzaxyuFXo1FmXNb8hyihRiorTRtfqsnmWqvQNUkiffqPOPWFFDEMQ3yierfq0XJS5dt68eO6C3hHtT/T8CQnUii/CH32M/h9KqlREDOUoA+etOCyLFdvdvebz0lNitQHFoEI2n6dWrnyekOoxnpGgc5g21bKyjZ7NdgzKpihfGB1EAE4yvIQPKjTT/tVu5BZULxmIKJdMQ2Z8mTx6NmlK', 'data2': 'ILPFwCLY7b4rnnxxc5c/+XTxu2CmS1rrIH/dL46/zqKWzvYkW+WRSd4wj6W2qUgIbsadVZosrlbUk+/kakDW3Yy+L7yJPWG19ZvDElU/NpaqBO1wn3aSi+uw5qf5ltdNxRyR224gbJeAhmAX2Qy4/0IACsezwNu5TxPVPPPMHGJKMslnmIZAVRzYBHVqyhVqldX1+Z2Bjgpgvrzv4+cXXABC4LyaPRSU5w+hfWPIdGMPzzSe22b7+kM2s', 'data3': 'qkI2/M0mdE1pQT+k+uIfoT5CkXQtbj5M09bYxiAtZOHbgQyYjkVuK/7JUKnzcLFeqSeyzWkctvHjZZn5V9EgF0QumeMB5JQjlQw2/LJlJdhQXMp45FD6dx+fM='} 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085a8df._ewelink._tcp.local.) [custom_components.sonoff] Properties: {'txtvers': '1', 'id': '100085a8df', 'type': 'strip', 'apivers': '1', 'seq': '1', 'encrypt': True, 'iv': 'NjAyNDU5NDQxOTM1NjY3Nw==', 'data1': 'pPZoYSDkkRC9Tg6rLX/qhHKS//U5jrzLeWJiWzaxyuFXo1FmXNb8hyihRiorTRtfqsnmWqvQNUkiffqPOPWFFDEMQ3yierfq0XJS5dt68eO6C3hHtT/T8CQnUii/CH32M/h9KqlREDOUoA+etOCyLFdvdvebz0lNitQHFoEI2n6dWrnyekOoxnpGgc5g21bKyjZ7NdgzKpihfGB1EAE4yvIQPKjTT/tVu5BZULxmIKJdMQ2Z8mTx6NmlK', 'data2': 'ILPFwCLY7b4rnnxxc5c/+XTxu2CmS1rrIH/dL46/zqKWzvYkW+WRSd4wj6W2qUgIbsadVZosrlbUk+/kakDW3Yy+L7yJPWG19ZvDElU/NpaqBO1wn3aSi+uw5qf5ltdNxRyR224gbJeAhmAX2Qy4/0IACsezwNu5TxPVPPPMHGJKMslnmIZAVRzYBHVqyhVqldX1+Z2Bjgpgvrzv4+cXXABC4LyaPRSU5w+hfWPIdGMPzzSe22b7+kM2s', 'data3': 'qkI2/M0mdE1pQT+k+uIfoT5CkXQtbj5M09bYxiAtZOHbgQyYjkVuK/7JUKnzcLFeqSeyzWkctvHjZZn5V9EgF0QumeMB5JQjlQw2/LJlJdhQXMp45FD6dx+fM='} 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085a8df._ewelink._tcp.local.) [custom_components.sonoff] Update service eWeLink_100085a8df._ewelink._tcp.local. 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085a8df._ewelink._tcp.local.) [custom_components.sonoff] State: {'sledOnline': 'on', 'configure': [{'startup': 'stay', 'outlet': 0}, {'startup': 'stay', 'outlet': 1}, {'startup': 'stay', 'outlet': 2}, {'startup': 'off', 'outlet': 3}], 'pulses': [{'pulse': 'off', 'width': 1000, 'outlet': 0}, {'pulse': 'off', 'width': 1000, 'outlet': 1}, {'pulse': 'off', 'width': 1000, 'outlet': 2}, {'pulse': 'off', 'width': 1000, 'outlet': 3}], 'switches': [{'switch': 'off', 'outlet': 0}, {'switch': 'off', 'outlet': 1}, {'switch': 'off', 'outlet': 2}, {'switch': 'off', 'outlet': 3}]} 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085a8df._ewelink._tcp.local.) [custom_components.sonoff] Properties: {'txtvers': '1', 'id': '100085a8df', 'type': 'strip', 'apivers': '1', 'seq': '1', 'encrypt': True, 'iv': 'NjAyNDU5NDQxOTM1NjY3Nw==', 'data1': 'pPZoYSDkkRC9Tg6rLX/qhHKS//U5jrzLeWJiWzaxyuFXo1FmXNb8hyihRiorTRtfqsnmWqvQNUkiffqPOPWFFDEMQ3yierfq0XJS5dt68eO6C3hHtT/T8CQnUii/CH32M/h9KqlREDOUoA+etOCyLFdvdvebz0lNitQHFoEI2n6dWrnyekOoxnpGgc5g21bKyjZ7NdgzKpihfGB1EAE4yvIQPKjTT/tVu5BZULxmIKJdMQ2Z8mTx6NmlK', 'data2': 'ILPFwCLY7b4rnnxxc5c/+XTxu2CmS1rrIH/dL46/zqKWzvYkW+WRSd4wj6W2qUgIbsadVZosrlbUk+/kakDW3Yy+L7yJPWG19ZvDElU/NpaqBO1wn3aSi+uw5qf5ltdNxRyR224gbJeAhmAX2Qy4/0IACsezwNu5TxPVPPPMHGJKMslnmIZAVRzYBHVqyhVqldX1+Z2Bjgpgvrzv4+cXXABC4LyaPRSU5w+hfWPIdGMPzzSe22b7+kM2s', 'data3': 'qkI2/M0mdE1pQT+k+uIfoT5CkXQtbj5M09bYxiAtZOHbgQyYjkVuK/7JUKnzcLFeqSeyzWkctvHjZZn5V9EgF0QumeMB5JQjlQw2/LJlJdhQXMp45FD6dx+fM='} 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085af42._ewelink._tcp.local.) [custom_components.sonoff] Update service eWeLink_100085af42._ewelink._tcp.local. 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085af42._ewelink._tcp.local.) [custom_components.sonoff] Properties: {'txtvers': '1', 'id': '100085af42', 'type': 'strip', 'apivers': '1', 'seq': '2', 'encrypt': True, 'iv': 'NTgzMzk2MDg0NTU4NjU1OA==', 'data1': 'XD9GVWz7rIi8B+Zp/tepZWo/ob3tZy1D6L8n5s19JxW+Dl/2HhXHkVx6oCZ1BeIGY5U9ZhlSJioPRrtgoKsXGL/snpO27hyQ8X3hit1envPwECVIFpC9b3Za3HfJ3bRIs6QzVFdS1bI90chBO06Wk36D7mvjitpnLL7/+e8nLx/uwciIZTr6q0LR9SplomhXv2ot2RS9l/GSv1oxJcZGSwp3IOjpY+0xPqdSgUFP8NL1xQIR6R5VfSGxm', 'data2': 'DlB/6NVKzrWjz8GWOk2dAv78cdvTE59mIsn0Ttwcgg7ko+6JBEXIlMUL4sTYfpIVTL3EcUvirHLUmMwUzz14hWnBuWicecPVi2iFn++7E5Jwno5xxnmxa3aosPBABLT4mYSKeLPSbbcxY+s4tJtBlzZQX8uGT1sIKN8s23uSYJFnASboCsyuLrd8kruZ1Xun994n58y75NSAR/Vyuy4uWFXKBn/xFrN3OCFS9SMUMC9OQ5SVY4ct0qBWh', 'data3': 'VJdO8xqIuwZpW/fHebwxRo7ZUstKW2JlSoQ2JC1CyfBTP18vWYOjFUpqMhEVyJLdhkfmXvjI8a/d51YYNtCe+mCQoB3kyihvZCXw=='} 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085af42._ewelink._tcp.local.) [custom_components.sonoff] State: {'sledOnline': 'on', 'configure': [{'startup': 'stay', 'outlet': 0}, {'startup': 'stay', 'outlet': 1}, {'startup': 'stay', 'outlet': 2}, {'startup': 'off', 'outlet': 3}], 'pulses': [{'pulse': 'off', 'width': 1000, 'outlet': 0}, {'pulse': 'off', 'width': 1000, 'outlet': 1}, {'pulse': 'off', 'width': 1000, 'outlet': 2}, {'pulse': 'off', 'width': 1000, 'outlet': 3}], 'switches': [{'switch': 'off', 'outlet': 0}, {'switch': 'on', 'outlet': 1}, {'switch': 'off', 'outlet': 2}, {'switch': 'off', 'outlet': 3}]} 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085af42._ewelink._tcp.local.) [custom_components.sonoff] Update service eWeLink_100085af42._ewelink._tcp.local. 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085af42._ewelink._tcp.local.) [custom_components.sonoff] Properties: {'txtvers': '1', 'id': '100085af42', 'type': 'strip', 'apivers': '1', 'seq': '2', 'encrypt': True, 'iv': 'NTgzMzk2MDg0NTU4NjU1OA==', 'data1': 'XD9GVWz7rIi8B+Zp/tepZWo/ob3tZy1D6L8n5s19JxW+Dl/2HhXHkVx6oCZ1BeIGY5U9ZhlSJioPRrtgoKsXGL/snpO27hyQ8X3hit1envPwECVIFpC9b3Za3HfJ3bRIs6QzVFdS1bI90chBO06Wk36D7mvjitpnLL7/+e8nLx/uwciIZTr6q0LR9SplomhXv2ot2RS9l/GSv1oxJcZGSwp3IOjpY+0xPqdSgUFP8NL1xQIR6R5VfSGxm', 'data2': 'DlB/6NVKzrWjz8GWOk2dAv78cdvTE59mIsn0Ttwcgg7ko+6JBEXIlMUL4sTYfpIVTL3EcUvirHLUmMwUzz14hWnBuWicecPVi2iFn++7E5Jwno5xxnmxa3aosPBABLT4mYSKeLPSbbcxY+s4tJtBlzZQX8uGT1sIKN8s23uSYJFnASboCsyuLrd8kruZ1Xun994n58y75NSAR/Vyuy4uWFXKBn/xFrN3OCFS9SMUMC9OQ5SVY4ct0qBWh', 'data3': 'VJdO8xqIuwZpW/fHebwxRo7ZUstKW2JlSoQ2JC1CyfBTP18vWYOjFUpqMhEVyJLdhkfmXvjI8a/d51YYNtCe+mCQoB3kyihvZCXw=='} 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085af42._ewelink._tcp.local.) [custom_components.sonoff] Update service eWeLink_100085af42._ewelink._tcp.local. 2020-02-18 11:14:27 DEBUG (zeroconf-ServiceBrowser_eWeLink_100085af42._ewelink._tcp.local.) [custom_components.sonoff] Properties: {'txtvers': '1', 'id': '100085af42', 'type': 'strip', 'apivers': '1', 'seq': '2', 'encrypt': True, 'iv': 'NTgzMzk2MDg0NTU4NjU1OA==', 'data1': 'XD9GVWz7rIi8B+Zp/tepZWo/ob3tZy1D6L8n5s19JxW+Dl/2HhXHkVx6oCZ1BeIGY5U9ZhlSJioPRrtgoKsXGL/snpO27hyQ8X3hit1envPwECVIFpC9b3Za3HfJ3bRIs6QzVFdS1bI90chBO06Wk36D7mvjitpnLL7/+e8nLx/uwciIZTr6q0LR9SplomhXv2ot2RS9l/GSv1oxJcZGSwp3IOjpY+0xPqdSgUFP8NL1xQIR6R5VfSGxm', 'data2': 'DlB/6NVKzrWjz8GWOk2dAv78cdvTE59mIsn0Ttwcgg7ko+6JBEXIlMUL4sTYfpIVTL3EcUvirHLUmMwUzz14hWnBuWicecPVi2iFn++7E5Jwno5xxnmxa3aosPBABLT4mYSKeLPSbbcxY+s4tJtBlzZQX8uGT1sIKN8s23uSYJFnASboCsyuLrd8kruZ1Xun994n58y75NSAR/Vyuy4uWFXKBn/xFrN3OCFS9SMUMC9OQ5SVY4ct0qBWh', 'data3': 'VJdO8xqIuwZpW/fHebwxRo7ZUstKW2JlSoQ2JC1CyfBTP18vWYOjFUpqMhEVyJLdhkfmXvjI8a/d51YYNtCe+mCQoB3kyihvZCXw=='}

In my case I cannot get statistics about Power, Voltage, etc. from my Sonoff POW2. I need this data, because it is important to monitor consumption and to do some actions if Power is 0 for more than x minutes.

is there a solution to make it send this data?
Depending on the answer I will decide to keep using this tool or to switch back to peterbuga /
HASS-sonoff-ewelink ?

Thank you in advance for the answer.

@LyZzardMD are they not in the attributes of your device?
Several users said that power is updated regularly and there is no problem with it.

@elserge82 there are a lot of updates in your logs. What exactly doesn’t work?

@elserge82 there are a lot of updates in your logs. What exactly doesn’t work?

The current voltage and power values are weird and refresh rate is very slow. when the switch is on I get 0 A and when it is off I get 3 A :D It's been along time I will check it back after the last updates.

Just to confirm that currently my switches are all off and still getting a value for the current and power different than zero. I guess I'm getting the first value on power outage only.

In my case all is 0. If I changes the status On->Off - i get the number changes. At restart of HA I get fresh values, but only once.

@elserge82 @LyZzardMD do you have the latest version of HA, component and device firmware?

Do you have default_config or zeroconf in your configuration.yaml?

What model of your rouer?

Up to date with default_config

Alex, not Maxx smile
Devices themselves send updates in this version of the component.

Lol at Maxx :) . Any Idea why my devices not sending updates except once per reboot? (I'm using a shared account credentials)

Hi Alexx, I have the same issue my pow's are not sending updates unless I open Ewelink app. Once I open Ewelink information on voltage a consumption gets updated in HA

Hello Alex! I have the same issue as @aequ-maker . Sonoff Pow R2 and Sonoff Th16 attributes updates only on start of hassio or if i open the ewelink app.

Btw thank you very much for the integration you made!

Everything is up to date!

@LyZzardMD Hi, are the sonoff sensors constantly update in Hassio? Because mine it gets updated only if I open the ewelink app on my phone.

Hi all. Update problem is related to multicast in local network/router.
I improved the work with zeroconf (multicast) in v1.10.2
Maybe it will help.

Tested it with v.1.10.2 but still the same. Anyway, just posted to let you know!

Tested it with v.1.10.2 but still the same. Anyway, just posted to let you know!

Same here, I've update and same behaviour it doesn't update unless I open eWelink app. I'll dig into my router config to see if there is any multicas settings :-)

I understand the problem, but I don’t know how to fix it.
I think the problem with router. I often heard problems from Huawei users.

Home Assistant sends a request to search for devices on the network, and it seems works.
Then, an update request is made for each device. And it seems to be a problem.

eWelink app sends a request to search for devices on the network again.

I will think what can be done with this.

I understand the problem, but I don’t know how to fix it.
I think the problem with router. I often heard problems from Huawei users.

Home Assistant sends a request to search for devices on the network, and it seems works.
Then, an update request is made for each device. And it seems to be a problem.

eWelink app sends a request to search for devices on the network again.

I will think what can be done with this.

Thank you for your time. As additional info my router is Asus-wrt

Thank you Alexx for pointing out the problem. I managed to make it work for 24 hours. by tweaking some parameters in the wifi professional tab. Tonight with further tests will let you know which one.

Edit: false alarm. By tweaking my WiFi pow r2 was blinking and unable to connect to server. This is why I was able to get power updates. Sorry my bad

Also if I turn off the power from a sonoff the HA still shows the device as online. Only if I restart HA shows the actual state of the sonoff device. On the other side if the device is offline and I start HA the device shows up as unavailable. Now, if I powered up the sonoff device the state of the sonoff device changes to available without having to restart HA.

Alexx,
I too have the same issue. I even tried setting discreet scan_interval in config.yaml for each device. I still only get updated values if I open the eWeLink app.

I have checked my logs and I restarted my HA. There was zeroconf messages upon restart but now it is 30 minutes later and there aren't any new zeroconf messages.

@AlexxIT the ideal solution would be the ability to set an update interval for the devices in some configuration file. This setting would force HA to scan the status of all the devices an update the state and related values. I use your integration to monitor my greenhouse with 10 sensors, a mixture of TH16 and POW2 and Basic.
I use influxdb for a local database and grafana for visualization. Really would like a polling interval setting. My admiration for getting this integration working.

@texbid what firmware is TH16 and POW2? Looks like an update request appeared in 3.5

@texbid what firmware is TH16 and POW2? Looks like an update request appeared in 3.5

3.4 for the TH 16with no firmware update listed
3.4 forthe POW2 no firmware update listed.

How did you get 3.5??

@texbid The dimmer got this firmware.

the sonoff mini has 3.5. but all others do not and no option to upgrade.

BTW i have asked the facebokgroup to buy you a coffee to push this development forward. really useful stuff.

@texbid thx. I have a lot of main work in recent months. Component development speed unfortunately decreased.

I noticed that the power attributes get updated when I switch on the sonoff POW using Home Assistant. I then setup an automation using the service switch.turn_on which runs every 5 minutes if the sonoff switch is already switched on as a condition. This is updating my power attributes every time it is being run.

I noticed that the power attributes get updated when I switch on the sonoff POW using Home Assistant. I then setup an automation using the service switch.turn_on which runs every 5 minutes if the sonoff switch is already switched on as a condition. This is updating my power attributes every time it is being run.

Tony, any tutorial on how to set this up?

My Sonoff POW R2 firmware is 3.3.1 and I am using Home Assistant 0.108.5 with Sonoff LAN 1.10.3

@tonyp740613 good solution. I'll think about making it out of the box.

The get Sonoff Data automaton works for me. I am currently using it to get temperature data from two Sonoff TH16s. Thanks again!

Good news. I found time for your problem (in latest master beta version):
https://github.com/AlexxIT/SonoffLAN#refresh-interval-for-th-and-pow

@AlexxIT I have 3 POW2 and 6 TH16. I have set up the config file with the suggested configuration lines

sonoff:
username: XXXXXX
password: XXXXXXXXX
reload: always
force_update: [temperature, power]
scan_interval: '00:01:00' # (optional) default 5 minutes
sensors: [temperature, humidity, power, current, voltage]

I have influx DB and grafana.

All component work, HOWEVER, grafana only shows me data points when a state change occurs. My understanding was that with Scan_interval I would get the data points for all devices at the desired time interval. This is not happening.

Am I missing something?

How do I get the data to display at the selected scan_interval?

@texbid I had no experience with grafana. Usually the same value does not count as an update.

With the temperature update, a bug is possible in the last component update.

Hi @AlexxIT , today i set up a new HomeAssistant and tried your integration after having major issues with the previous one I used. My TH16s are being found but niether temperature or humidity data is coming through. This is my config:

sonoff:
  username: my_email
  password: !secret sonoff_password
  reload: always
  force_update: [temperature, power]
  scan_interval: '00:02:00'  # (optional) default 5 minutes
  sensors: [temperature, humidity, power, current, voltage]

I've just seen 2.1.2 was released. testing it now.

Works perfectly so far. I've disabled humidity on the one which only has a waterproof temp sensor which doesn't have a humidity sensor.

Thank you!!

Log Details (WARNING)
Logger: homeassistant.helpers.entity
Source: helpers/entity.py:284
First occurred: 23:06:22 (1 occurrences)
Last logged: 23:06:22

Entity sensor.sonoff_1000bd2eda_humidity is incorrectly being triggered for updates while it is disabled. This is a bug in the sonoff integration.

@grantwils created new issue #145

@grantwils I checked the situation. Need to restart HA after disabling the device. And everything works well.

I have Sonoff POWR2 and I am having an issue with the config, I believe.

The log is showing:
Can't connect to eWeLink Cloud
11:08:24 PM – (WARNING) Sonoff (custom integration)
Login error: {'error': 404, 'msg': 'user is not exit'}
11:08:24 PM – (ERROR) Sonoff (custom integration)

I have the ewelink application and can confirm that this is my user name. The password was created at that time and logged. I cannot find a way to login to ewelink.cc though to confirm that I have an account. In my app, when I go to my Profile, all the buttons are greyed out for Timers and Scenes because I have a Free plan. I could run it all locally if I knew how to identify the device name and configure it right.

sonoff:
  username: me@gmail.com
  password: SonoffPW
  force_update: [temperature, power]
  scan_interval: '00:01:00'  # (optional) default 5 minutes
  sensors: [temperature, humidity, power, current, voltage]

Suggestions for identifying the device and naming it in config? Or what is wrong with the ewelink login?

I saw this error only when login was wrong

Thanks for the quick reply, and for the development work!

I saw this error only when login was wrong

Through the ewelink app, I was able to change the password. The app gave me a message "password changed." I then updated the /config/configuration.yaml file. I returned to HomeAssistant, restarted it, and viewed the log file, and received the same error message.

Is this functionality only available with some kind of paid account (not free) from ewelink?

Home Assistant Info:

  • Home Assistant 2021.8.2
  • Path to configuration.yaml: /config

Logger: custom_components.sonoff
Source: custom_components/sonoff/init.py:107
Integration: Sonoff (documentation, issues)
First occurred: 9:03:15 AM (1 occurrences)
Can't connect to eWeLink Cloud

Logger: custom_components.sonoff.sonoff_cloud
Source: custom_components/sonoff/sonoff_cloud.py:289
Integration: Sonoff (documentation, issues)
First occurred: 9:03:15 AM (1 occurrences)

Login error: {'error': 404, 'msg': 'user is not exit'}

Thanks for the quick reply, and for the development work!

I saw this error only when login was wrong

Through the ewelink app, I was able to change the password. The app gave me a message "password changed." I then updated the /config/configuration.yaml file. I returned to HomeAssistant, restarted it, and viewed the log file, and received the same error message.

Is this functionality only available with some kind of paid account (not free) from ewelink?

Home Assistant Info:

  • Home Assistant 2021.8.2
  • Path to configuration.yaml: /config

Logger: custom_components.sonoff
Source: custom_components/sonoff/init.py:107
Integration: Sonoff (documentation, issues)
First occurred: 9:03:15 AM (1 occurrences)
Can't connect to eWeLink Cloud

Logger: custom_components.sonoff.sonoff_cloud
Source: custom_components/sonoff/sonoff_cloud.py:289
Integration: Sonoff (documentation, issues)
First occurred: 9:03:15 AM (1 occurrences)

Login error: {'error': 404, 'msg': 'user is not exit'}

Think I figured it out. Firmware is 2.6.1 but for some reason, it indicates it is the Latest Version of the firmware and is not upgradable. Ugh. Guess I will back up the flash, and find another firmware for flashing.

Thanks for the help!

Error depends on username, not on password.

commented

Temperature refresh is not the same at 4 sensors i have.

After HA restart all temperatures were updated. After, its random - some sensors update every 5-10 minutes others after 2-3 hours. How i can force update every X minutes?

--UPDATE --

After that fix refresh interval is more offen but its not the same for all sensors ( picture here: https://imagizer.imageshack.com/img924/5788/KZ0NTr.png ).

Not sure if this has been covered already, but I had similar refresh problems (I have a couple of TH16s with temp and humidity sensors, and a couple of Pow devices. I also have a zigbee bridge and rf433 bridge, along with a bunch of Livarno light bulbs, all of which SonoffLAN has got working after a fashion).

I had all my wifi devices connected by a 2.4GHz access point, which was plugged in to my vigor router for reasons I won't go in to (but are mostly down to my brain having a few days off 😀).

The draytek defaults with multicast functions disabled, and when enabled will still stop all multicast on a LAN port if a leave signal is received on it.

The fix for me was to enable IGMP proxy (with snooping, and fast leave still enabled - on the Vigor, this is found in the application menu dropdown). The IGMP proxy acts as a multicast proxy for hosts on the LAN side, including the 2.4GHz wifi and 5GHz wifi.

Sensors are updating perfectly (I have it set at 20 seconds, but will relax that when I'm happy it isn't going to spit the dummy any time soon).

Absolutely awesome job Alex, and thank you for going to the trouble of creating this - I had been swearing for about 2 months after discovering my devices stopped either when I had Internet problems, or when ewelink had server problems. Definitely worth a coffee and a bacon roll 😀 🍵🍔.