Dimmable and dumb


#1

I've purchased this board a year ago, and it works perfectly with Alexa. Alexa sees it as a Philips Hue 2012
tindie . com
/products
/Armtronix
/wifi-ac-dimmer-esp8266-one-triac-board-alexaecho

I'm new to the Hubitat environment, and are now planning on leaving the cloude with this new system. I'm dependent on the cloud for Alexa, but she's not critical.

It's very simple, but does what I want, and that is turning off or on + it's dimmable.
I'm using Alexa to controle it now, but with the new Hubitat, I'd like to expand the use.

To controle it manually, you toggele it on/off with
192.168.10.xx / gpio?state_sw=0 or 1
And the dimmer, is controled with 0-100%, like this
192.168.10.xx / gpio?state_dimmer=70
What is the best app in Hubitat to controle a simple solution like this?

Regards Morten


#2

Welcome to the Hubitat Community!

You can do this with Rule Machine and HTTP Get requests for the actions, but @kv1 just posted a simple driver for X10 that would do the trick for you as well.

Here's a RM action for HTTP Get


#3

Thank you SmartHomePrimer. Tested the driver. This was just what I was looking for.
That's the on/off taken care of.
What about the dimmer? Is there a driver that will allow me to set a %-value for the dimmer?
I haven't tested the Rule Machine yet. Is this capable of dimming?

In the log page, it seams like the dimmer sends info / values back. Not sure if this is true, but what is the best way to figure that out?

192.168.10.xx/device/edit/1
TRIAC is now ONChange to TRIAC_ONTRIAC_OFF Change to function showValue(dimming){ document.querySelector('#state_dimmer').value=dimming ; document.forms['state'].submit();}

192.168.10.xx/device/edit/1
Sending GET/ON request to [192.168.10.xx/gpio?state_sw=1]

Thank you for the rapid reply. I really love this flexible and powerfull unit.


#4

Sorry I’m not a developer, but someone here could probably help you with custom code to handle that, or there might be something existing that could be modified.

Search for Sonoff here. That likely would have a similar scenario to start from.


#5

The driver you are using will need to be modified to allow the use of Dimming. If you can post a copy of it here, in this thread, I'll take a look at adding some code to help get you started.

When copying and pasting code into this thread... please be sure to highlight/select all of the code, and then click the Preformatted Text menu button - it looks like "</>". This will allow the code to be easily read and copied.


#6

He used this code from @kv1

/*

* Http GET Switch
* Calls URIs with HTTP GET for switch on or off

*/
metadata {
definition(name: "Http GET Switch", namespace: "community", author: "Community") {
capability "Actuator"
capability "Switch"
capability "Sensor"
}
}

preferences {
section("URIs") {
input "onURI", "text", title: "On URI", required: false
input "offURI", "text", title: "Off URI", required: false
input name: "logEnable", type: "bool", title: "Enable debug logging", defaultValue: true
}
}

def logsOff() {
log.warn "debug logging disabled..."
device.updateSetting("logEnable", [value: "false", type: "bool"])
}

def updated() {
log.info "updated..."
log.warn "debug logging is: ${logEnable == true}"
if (logEnable) runIn(1800, logsOff)
}

def parse(String description) {
if (logEnable) log.debug(description)
}

def on() {
if (logEnable) log.debug "Sending on GET request to [${settings.onURI}]"

```
try {
    httpGet(settings.onURI) { resp ->
        if (resp.success) {
            sendEvent(name: "switch", value: "on", isStateChange: true)
        }
        if (logEnable)
            if (resp.data) log.debug "${resp.data}"
    }
} catch (Exception e) {
    log.warn "Call to on failed: ${e.message}"
}
```

}

def off() {
if (logEnable) log.debug "Sending off GET request to [${settings.offURI}]"

```
try {
    httpGet(settings.offURI) { resp ->
        if (resp.success) {
            sendEvent(name: "switch", value: "off", isStateChange: true)
        }
        if (logEnable)
            if (resp.data) log.debug "${resp.data}"
    }
} catch (Exception e) {
    log.warn "Call to off failed: ${e.message}"
}
```

}

#7

The code you pasted is full of random characters that shouldn’t be in there. That’s why I asked the OP to paste his working code...:thinking:


#8

Yeah like ...

I think that's from the pre-formatting of the OP being messed up. :grinning: