BrettSheleski / SmartThingsPublic

36 stars 23 forks source link

Not spawning Tasmota-Power #17

Closed jaysuk closed 5 years ago

jaysuk commented 5 years ago

I have two sonoffs currently configured using your Device handler. 1 is a sonoff basic. The tasmota-power is being spawned correctly and controls the device. The other is a sonoff BN-SZ01 (module 22). The correct data is being pulled by for the tasmota device but it is not spawning a tasmota-power device for it. Any suggestions?

BrettSheleski commented 5 years ago

I'm not familiar with the device and looking at the code it looks like it should be spawning a child device for module 22.

As I don't have that device, I won't be able to do any real testing. I'd suggest opening the simulator in the SmartThings IDE and see what's up.

jaysuk commented 5 years ago

When I run the simulation against the physical item, I get an error when it first runs. error java.lang.NumberFormatException: For input string: "" @line 289 (getGpioDevices) is this because tasmota has no GPIO's that are allowed to be set for this device?

BrettSheleski commented 5 years ago

I have a feeling Tasmota returns a non-JSON string for some module types when retrieving the GPIO configuration and thus errors out. Personally, I feel this is a bug with Tasmota, but this device handler can be modified to check for that condition.

To verify, can you see what returns when you go to http://ip-of-your-sonoff/cm?cmnd=gpio ?

For one of my devices (Sonoff Basic), it returns the following JSON:

{"GPIO1":"0 (None)","GPIO3":"0 (None)","GPIO4":"0 (None)","GPIO14":"10 (Switch2)"}

As you can see, this is a valid JSON string. I have a feeling your device is returning non-JSON string.

BrettSheleski commented 5 years ago

I updated stuff on GitHub that should hopefully address this.

I also moved some files/folders around for better integration with SmartThings' GitHub integration. Apparently the BrettSheleski folder needs to be all lowercase and is changed to brettsheleski for the it to be compatible with SmartThings. I love SmartThings' lack of documentation.

jaysuk commented 5 years ago

Looks like thats worked. It has now spawned a switch for the light. I was also able to update using github which i couldn't do before. I will confirm and close this issue once I get home as at the moment I can't actually test it.

liviuaugustin commented 5 years ago

Today I updated the: Smartapp and handlers, now are not working anymore. The new instructions are a little..confusing. Changing the name was a good idea, now I can use GitHub integration but all the links posted in ST Community are not working anymore.

BrettSheleski commented 5 years ago

What links in ST Community? I'm pretty sure I haven't posted any.

liviuaugustin commented 5 years ago

Other yes.

liviuaugustin commented 5 years ago

Actually all your links from "Read me.md" are not working: Page not Found.

BrettSheleski commented 5 years ago

I'm assuming GitHub is case sensitive and since I renamed the directory to lower case, all those links stopped working. I'll have to update the links.

liviuaugustin commented 5 years ago

Sorry. the integration was working fine for me, I was using your code from the beginning but today I do not know why I update everything and now I have problems controlling the switches. Maybe you need to reorganize everything.

liviuaugustin commented 5 years ago

After updating the Tasmota-Power handler I Get this: GPIO NULL ,9122650137035844561

BrettSheleski commented 5 years ago

The links in the readme.md files should all be updated now. I also updated the link on the Tasmota Wiki.

liviuaugustin commented 5 years ago

I am using your code with 2 Sonoff 4CH Pro (you can Add it to wiki list) and was working fine till today :(

BrettSheleski commented 5 years ago

I don't remember why I even added GPIO stuff to the Tasmota-Power device handler. From a cursory glance at the code, I don't see how that would cause anything to fail.

liviuaugustin commented 5 years ago

I don't know what GPIO do. Is something strange here. I was using your code without 4ch handler, Now adding 4ch handler I have this error.

7467499123625016846

BrettSheleski commented 5 years ago

I wouldn't use the Sonoff-Tasmota 4CH handler. I think I churned that one out quickly without much testing a while ago basically by request from someone. That was before the newer Tasmota set of handlers was created.

Just delete the Sonoff-Tasmota 4CH device handler. I should add a message indicating its deprecation.

From what the message says in the tooltip, I'm guessing you modified something in whatever version of the Tasmota device handler you currently are using.

To resolve, I'd try editing the device handler and manually copy and paste the updated version over whatever you currently have. After that I'm guessing the GitHub integration will work again.

liviuaugustin commented 5 years ago

I erased the 4ch handler, now I have no error. Can I have a older version of tasmota-power.groovy ? Maybe I need to erase and reinstall everything. the switches are not working :(

liviuaugustin commented 5 years ago

2669340535460268728

BrettSheleski commented 5 years ago

I haven't made any changes to the Tasmota-Power device handler in quite some time. I'd suggest just looking at history, but after the renaming of the directory, that is kind of useless.

To get a prior version, clone the repository and do some git-magic and retrieve whichever version you'd like.

liviuaugustin commented 5 years ago

Maybe is the smartapp or tasmota handler. I will do some testing. Thank you.

jaysuk commented 5 years ago

All is working well here now.

Thanks!