GithubHelp home page GithubHelp logo

hubitat-by-mavrrick's People

Contributors

kurtsanders avatar mavrrick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

hubitat-by-mavrrick's Issues

Hubitat : Govee - Extract Scene fails

In Hubitat : Govee integration, when I click "Extract Scene", I receive the error below. I tried with both all of my devices remote and all of them local.

(Debug level set to "Trace")

[app:7](http://192.168.0.208/logs#)2023-12-05 11:14:16.681 AM[error](http://192.168.0.208/logs#)java.lang.NullPointerException: Cannot invoke method get() on null object on line 353 (method sceneExtract) [app:7](http://192.168.0.208/logs#)2023-12-05 11:14:16.624 AM[debug](http://192.168.0.208/logs#)sceneExtract(): found Default group moving forward [app:7](http://192.168.0.208/logs#)2023-12-05 11:14:16.167 AM[debug](http://192.168.0.208/logs#)sceneExtract(): Calling HTTP server [app:7](http://192.168.0.208/logs#)2023-12-05 11:14:16.165 AM[debug](http://192.168.0.208/logs#)sceneExtract() DEVICE INFORMATION

Script

No signature of method: Script1.definition() is applicable for argument types: (java.util.LinkedHashMap) values: [[name:Govee Integration , namespace:Mavrrick, author:CRAIG KING, ...]] on line 17

swap devices

Hello! I don't think this is really a bug just an issue I ran into. I recently purchased new Govee light bulbs (H6010) to replace my old ones. I realized that I couldn't just use the Swap Apps Device feature in settings, Guessing it's because Govee devices are children? No idea. So then I tried a hacky way of just changing the device IDs on their device page, which ended up failing because that new device ID isn't getting updated for its device.getDataValue("deviceId"). I've sorta fixed it, however, my background is in javascript so i gave it my best college try.
I added this to initialize

def initialize(){
	if (device.getDataValue("deviceID") != device.deviceNetworkId) {
        if (debugLog) {log.warn "initialize(): Detected new Device Network Id : ${device.deviceNetworkId}, Applying"}
        newDeviceNetworkId = device.deviceNetworkId.toString()
        updateDeviceInfo(newDeviceNetworkId)
    }

and then added the code below, updateDataValue() is complaining about the following key:value pairs - commands, ctMax, and ctMin. not sure what to do about that, tried using updateSetting() but my new devices started working so I couldn't test it.

def updateDeviceInfo(newDeviceNetworkId) {

		def params = [
			uri: "https://developer-api.govee.com",
			path: '/v1/devices',
			headers: ["Govee-API-Key": device.getDataValue("apiKey"), "Content-Type": "application/json"],
		]

try {

			httpGet(params) { resp ->
                
				resp.data.data.devices.each {
                    if (debugLog) {log.warn "checking device ${it.device}"}
					deviceID = it.device
					deviceModel = it.model
					deviceName = it.deviceName
					controllable = it.controllable
					retrievable = it.retrievable
					supportCmds = it.supportCmds
					if (newDeviceNetworkId.contains(deviceID)) {
                        if (debugLog) {log.warn "found new device ${deviceID}"}
						device.updateDataValue("deviceID", deviceID)
                        device.updateDataValue("deviceModel", deviceModel)          
                        device.updateSetting("commands", supportCmds)
						if (supportCmds.contains('colorTem') && supportCmds.contains('color')) {
							ctMin = it.properties.colorTem.range.min
							ctMax = it.properties.colorTem.range.max
							device.updateSetting("ctMin", ctMin)
							device.updateSetting("ctMax", ctMax)
						} else if (supportCmds.contains('brightness')) {
							device.updateSetting("ctMin", 'N/A')
							device.updateSetting("ctMax", 'N/A')
						}
					}
              }
          }
	} catch (groovyx.net.http.HttpResponseException e) {
		log.error "Error: e.statusCode ${e.statusCode}"
		log.error "${e}"
		return 'unknown'
	}
}

this might all be trash, but a way of swapping devices would be nice! Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.