Tuya Cloud expired

消費電力が確認できるGosundスマートプラグtinytuyaを使ってモニタリングをしていたのだが、気がついたら消費電力が採れなくなっていた。

調べてみるとtinytuya.OutletDeviceで

{'Error': 'Unexpected Payload from Device', 'Err': '904', 'Payload': None}

というエラーになっている状況はわかったものの、原因はピンとこない。

試しにtinytuya wizardしたところ、

yano@haswell:~$ python3 -m tinytuya wizard
TinyTuya Setup Wizard [1.13.2]
    Existing settings:
        API Key=acvwux..........p55y
        Secret=3b81eb715...................3819
        DeviceID=1826...........b47b
        Region=us
    Use existing credentials (Y/n): 
~~
Error from Tuya server: Error from Tuya Cloud: Code 28841002: '**No permissions. Your subscription to cloud development plan has expired.**'
Check DeviceID and Region
yano@haswell:~$

となった。

Tuya Cloudを使っているつもりは無いんだけどなー、とは思ったが、ここで駄々をこねても仕方がないのでSmart LifeTuya Cloudのアカウントを作り直し、Tuya Cloud 操作をやり直してLocalKeyを更新する事で、無事にtinytuya.OutletDeviceからも

{'devId': '1826...........b47b', 'dps': {'1': True, '9': 0, '18': 81, '19': 40, '20': 1008, '21': 1, '22': 735, '23': 31250, '24': 21478, '25': 970}}

という応答が返ってくるようになり、やれやれ。

ちなみにSmart Lifeのアカウント再設定では、スマートプラグをペアリングモードにしてデバイスを追加する必要があるのだが、WP6はBlueTooth機能がないらしくAPモードにして手動でWP6側のWiFiに接続する必要があり、微妙に苦労した。しかも、よく考えるとTuya Cloudの新しいアカウントにリンクし直すだけで、Smart Lifeの方はそのままで良かった気がする。

参照

DIY Smart Matter https://diysmartmatter.com/

ファームロジックス https://flogics.com/

Qiita https://qiita.com/

Tuya Smart Developer Center https://iot.tuya.com/

GitHub https://github.com/

Google Play のアプリ https://play.google.com/store/apps/

Wikipedia https://en.wikipedia.org/wiki/