stevecohen / homebridge-bomgovau Goto Github PK
View Code? Open in Web Editor NEWMakes BOM.gov.au data available in your Homebridge(Homekit) setup
Makes BOM.gov.au data available in your Homebridge(Homekit) setup
Hey @SteveCohen, not a major one, but figured it could be worth applying for Homebridge Verified. I think all you have to do is submit an issue on this github page:
sudo npm install -g homebridge-bomgovau
npm ERR! code 128
npm ERR! Command failed: /usr/bin/git submodule update -q --init --recursive
npm ERR! fatal: Could not change back to '/root/.npm/_cacache/tmp/git-clone-e7bfccc2': Permission denied
npm ERR!
HomeBridge v1.3.4
homebridge-bomgovau v0.1.3
When using the JSON data linked from here http://www.bom.gov.au/products/IDN60901/IDN60901.94763.shtml
[7/21/2021, 8:32:35 PM] [BOM] Current Time is 1626863555065, BOM data expires at 0
[7/21/2021, 8:32:35 PM] [BOM] Updating observations from BOM.
(node:21723) UnhandledPromiseRejectionWarning: FetchError: invalid json response body at http://www.bom.gov.au/fwo/IDN60901/IDN60901.94763.json reason: Unexpected token < in JSON at position 0
at /homebridge/node_modules/homebridge-bomgovau/node_modules/node-fetch/lib/index.js:272:32
at processTicksAndRejections (internal/process/task_queues.js:95:5)
(node:21723) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)
(node:21723) UnhandledPromiseRejectionWarning: FetchError: invalid json response body at http://www.bom.gov.au/fwo/IDN60901/IDN60901.94763.json reason: Unexpected token < in JSON at position 0
at /homebridge/node_modules/homebridge-bomgovau/node_modules/node-fetch/lib/index.js:272:32
at processTicksAndRejections (internal/process/task_queues.js:95:5)
(node:21723) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 6)
about the only thing i can see different is theres no press values at that station. but the JSON seems valid.
Hi Steve
The sample configuration in the readme has the station URL quoted as "stationurl". This results in the Canberra default being used. It should read "stationURL”.
Cheers
Richard
Hi Steve,
Great plugin, works without a hitch. Can a value be pulled from BOM re 'chance of rain'? Be handy as I want to link my sprinklers to it.
Hi.
Recently installed this plugin but it's not loading causing the line No plugin was found for the accessory "BOMgovau" in your config.json. Please make sure the corresponding plugin is installed correctly.
to show up in the log. Digging a bit deeper the following also appears in the log...
[15/10/2021, 9:39:44 pm] ====================
[15/10/2021, 9:39:44 pm] ERROR LOADING PLUGIN homebridge-bomgovau:
[15/10/2021, 9:39:44 pm] Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /usr/lib/node_modules/homebridge-bomgovau/node_modules/node-fetch/src/index.js
require() of ES modules is not supported.
require() of /usr/lib/node_modules/homebridge-bomgovau/node_modules/node-fetch/src/index.js from /usr/lib/node_modules/homebridge-bomgovau/index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename /usr/lib/node_modules/homebridge-bomgovau/node_modules/node-fetch/src/index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /usr/lib/node_modules/homebridge-bomgovau/node_modules/node-fetch/package.json.
at new NodeError (internal/errors.js:322:7)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1102:13)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at Object.<anonymous> (/usr/lib/node_modules/homebridge-bomgovau/index.js:9:13)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
[15/10/2021, 9:39:44 pm] ====================
Installed versions
Homebridge v1.3.5
Node.js v14.18.0
Npm 6.14.15
Thanks,
Shannon
Hey @SteveCohen I am not sure if you are aware but the next version of Homebridge (v2.0) comes with breaking changes for a lot of Homebridge plug-ins and it has been put on the developers to update their plug-ins.
I have tested this plug-in on the beta version and it will crash Homebridge.
Describe the solution you'd like:
Please have a read of the link above and see what changes are required for this plug-in.
Describe alternatives you've considered:
All users of this plug-in will have to remain on Homebridge v1.8.4.
Logs:
[27/07/2024, 3:50:29 pm] [Location] Initializing BOMgovau accessory...
[27/07/2024, 3:50:29 pm] [Location] [BOM gov au] Enabling sensors
[27/07/2024, 3:50:29 pm] [Location] [BOM gov au] Sensor temperature = true
[27/07/2024, 3:50:29 pm] [Location] [BOM gov au] Sensor humidity = true
[27/07/2024, 3:50:29 pm] [Location] [BOM gov au] Sensor apparentTemp = true
[27/07/2024, 3:50:29 pm] [Location] [BOM gov au] Station Name is Location
[27/07/2024, 3:50:29 pm] [Location] [BOM gov au] Station URL is http://www.bom.gov.au/fwo/IDWXXXXX/IDWXXXXX.XXXXX.json
[27/07/2024, 3:50:29 pm] TypeError: Class constructor Characteristic cannot be invoked without 'new'
at new CommunityTypes.AtmosphericPressureLevel (/usr/local/lib/node_modules/homebridge-bomgovau/node_modules/hap-nodejs-community-types/types.js:445:20)
at TemperatureSensor.addCharacteristic (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Service.ts:528:57)
at new BOMgovau (/usr/local/lib/node_modules/homebridge-bomgovau/index.js:87:33)
at /usr/local/lib/node_modules/homebridge/src/server.ts:362:50
at Array.forEach (<anonymous>)
at Server.loadAccessories (/usr/local/lib/node_modules/homebridge/src/server.ts:282:29)
at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:167:12)
[27/07/2024, 3:50:29 pm] Got SIGTERM, shutting down Homebridge...
[27/07/2024, 3:50:29 pm] AssertionError [ERR_ASSERTION]: Cannot generate setupURI on an accessory that isn't published yet!
at Bridge.setupURI (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:897:11)
at Server.setServerStatus (/usr/local/lib/node_modules/homebridge/src/server.ts:143:45)
at Server.teardown (/usr/local/lib/node_modules/homebridge/src/server.ts:187:10)
at signalHandler (/usr/local/lib/node_modules/homebridge/src/cli.ts:90:12)
at process.emit (node:events:519:28)
at process.emit (/usr/local/lib/node_modules/homebridge/node_modules/source-map-support/source-map-support.js:516:21)
[27/07/2024, 3:50:34 pm] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[27/07/2024, 3:50:39 pm] [HB Supervisor] Restarting Homebridge...
Hi @SteveCohen since the new release of Homebridge I get the following warning in my Homebridge logs upon startup. It says I should contact you to let you know, hopefully you know what needs changing?
Thanks :)
Hey Steve,
Plug-in works great, thanks.
Just one to add to your future enhancement list, adding fakegato support.
Thanks again.
I may have missed it, but how to install with NPM?
My local station doesn't have humidity data, so that sensor is sitting useless at 0%. Would love if you could add a "Disable Humidity" etc. flag to the config
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.