razorRun / node-red-contrib-smartlifeair

Allow you to integrate any[almost] tuya, smart life supported devices to node-red. However, you will have to enrol these devices via Smart life air mobile app. https://www.smartlife.nz/smartlife-labs
https://roshan.digital/
13 stars 1 forks source link

Ok, this may be a big ask, but thought I would ask, just in case there is a way to do it? #12

Closed Nodi-Rubrum closed 3 years ago

Nodi-Rubrum commented 3 years ago

Ok, this may be a big ask, but thought I would ask, just in case there is a way to do it? I have a use case where I want to power down a smart plug and then have the plug power up say 30 seconds or a minute later.

This has to be independent of issuing commands via NR communication. This would seem to be possible if one schedules a power down and then schedules a power up on the given plug. But how would one do this via the node?

Via the phone app it can be done, as I recall it is limited to 1 minute interval or larger, but still can be done. For example, the current time is 10pm, so schedule off at 10:01, then schedule on at 10:02. As I understand it, this is completely localized, the schedule is on the device, no external communication needed, or am I wrong about that?

razorRun commented 3 years ago

You should able to do this using NR logics, but as you want to stay away from that(Are you thinking use this to restart the machine that runs the NR?),

why don't you set up automation logic in the app saying when the power plug goes down, turn it on 1min later ?

dachshund-digital commented 3 years ago

The issue is, I will not have WiFi connectivity/external to my network, during the count down. The plug is the power control for my internet router. If I could flash the firmware on the plug so it was local only, that would work, since I could use a local access point to keep WiFi online and thus NR connectivity. But the plugs have been locked, can't flash them with custom firmware. Of course, I could create my own solution using a generic ESP module, using a relay, but wanted to try to avoid that. So was thinking if your API could control the onboard timer? Most smart plugs have an onboard timer, for scheduled events.

dachshund-digital commented 3 years ago

I think I got it... using a smart plug that SmartLife Air can see the 'countdown' setting, appears to be working, still need to test if the countdown feature is truly on-board only, and not somehow talking to anything.

dachshund-digital commented 3 years ago

Nope, the countdown will turn off the plug at expiration, what I need is to turn on the plug after the countdown expires, when no connectivity is available. Not sure I can get that logic with the current design(s). If I could query the state of the plug using only local connectivity I think I could get what I need. Rats.... would be nice to countdown to ON state not OFF state.

razorRun commented 3 years ago

Yep. And i will not be able to do anything local with the current architecture.

So yep. Best option is to plug a 3/4G dongle with a shared data plan. We can get these in NZ without any additional cost. Will just use data from your main plan. This can stay as a backup for your critical Automations

On Fri, 6 Nov 2020 at 5:45 AM, dachshund-digital notifications@github.com wrote:

Nope, the countdown will turn off the plug at expiration, what I need is to turn on the plug after the countdown expires, when no connectivity is available. Not sure I can get that logic with the current design(s).

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/razorRun/node-red-contrib-smartlifeair/issues/12#issuecomment-722497654, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFB72EEK42F33QZ4XK67NFTSOLJENANCNFSM4RWR57LQ .

dachshund-digital commented 3 years ago

Yeah... one question is there a way to send two inputs? If I could send timer value and the state I want after timer expires? Right now the countdown assumes the desired state if OFF, right? But when I use any of the phone apps... I can have a countdown and turn ON, or countdown and turn OFF? as a scheduled item? For example, countdown turn ON, dountdown turn OFF is what I do on one of my plugs. But the NR node seems to be just download to OFF only? Is the schedule stuff done off device or on device?

razorRun commented 3 years ago

You can just create 2 nodes with the same input. I don't wanna enable JSON input as most people will have an issue with channel names

Nodi-Rubrum commented 3 years ago

Ah, so no timing issue? Or do I want to make sure the order of inputs is 'configuration' input before 'change state' input?

Nodi-Rubrum commented 3 years ago

Closing for now, since alternate method possible, will only reopen if can't get alternate method working.