bt-sensors-plugin-sk 1.2.5-1 → 1.2.6-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BTSensor.js +74 -38
- package/DistanceManager.js +249 -0
- package/Mixin.js +19 -0
- package/OutOfRangeDevice.js +46 -0
- package/README.md +14 -0
- package/classLoader.js +7 -2
- package/connectUUID.exp +26 -0
- package/index.js +49 -3
- package/package.json +8 -6
- package/public/159.js +1 -1
- package/public/540.js +1 -1
- package/public/681.js +3 -9
- package/public/681.js.LICENSE.txt +2 -0
- package/public/764.js +1 -0
- package/public/images/ATC.jpeg +0 -0
- package/public/images/Aranet4.webp +0 -0
- package/public/images/BP108B.webp +0 -0
- package/public/images/GoveeH5074.jpg +0 -0
- package/public/images/GoveeH5075.webp +0 -0
- package/public/images/GoveeH510x.jpg +0 -0
- package/public/images/InkbirdTH3.webp +0 -0
- package/public/images/JBDBMS.webp +0 -0
- package/public/images/Junctek.webp +0 -0
- package/public/images/KilovaultHLXPlus.jpg +0 -0
- package/public/images/LancolVoltageMeter.webp +0 -0
- package/public/images/LiTimeLiFePo4Battery.avif +0 -0
- package/public/images/MercurySmartcraft.jpg +0 -0
- package/public/images/MopekaTankSensor.jpg +0 -0
- package/public/images/RemoranWave3.jpeg +0 -0
- package/public/images/RenogyInverter.jpg +0 -0
- package/public/images/RenogyRoverClient.jpg +0 -0
- package/public/images/RenogySmartLiFePo4Battery.webp +0 -0
- package/public/images/RuuviTag.jpg +0 -0
- package/public/images/ShellyBLUHT.webp +0 -0
- package/public/images/ShellyBLUMotion.webp +0 -0
- package/public/images/ShellyBluDoorWindow.webp +0 -0
- package/public/images/Skanbatt.jpg +0 -0
- package/public/images/SmartBatteryProtect.webp +0 -0
- package/public/images/SmartBatterySense.webp +0 -0
- package/public/images/SwitchBotMeterPlus.webp +0 -0
- package/public/images/SwitchBotTH.webp +0 -0
- package/public/images/TopbandBattery.webp +0 -0
- package/public/images/Ultrasonic.jpg +0 -0
- package/public/images/VictronBlueSmartACCharger.jpg +0 -0
- package/public/images/VictronBlueSolarMPPT.jpeg +0 -0
- package/public/images/VictronCerboGX.webp +0 -0
- package/public/images/VictronInverterRS.webp +0 -0
- package/public/images/VictronLynxSmartBMS.webp +0 -0
- package/public/images/VictronMultiPlus-II.webp +0 -0
- package/public/images/VictronOrionTrIsolated.webp +0 -0
- package/public/images/VictronOrionTrNonIsolated.webp +0 -0
- package/public/images/VictronPhoenixInverter.webp +0 -0
- package/public/images/VictronPhoenixSmart1600.webp +0 -0
- package/public/images/VictronSmartBatteryProtect.jpg +0 -0
- package/public/images/VictronSmartIP43.webp +0 -0
- package/public/images/VictronSmartLithiumBattery.jpg +0 -0
- package/public/images/VictronSmartSolarMPPT.webp +0 -0
- package/public/images/VictronVEBus.webp +0 -0
- package/public/images/iBeacon.jpg +0 -0
- package/public/main.js +1 -1
- package/public/remoteEntry.js +1 -1
- package/readUUID.exp +23 -0
- package/sensor_classes/ATC.js +3 -2
- package/sensor_classes/Aranet2.js +3 -1
- package/sensor_classes/Aranet4.js +1 -2
- package/sensor_classes/BankManager.js +1 -1
- package/sensor_classes/Beacon/AbstractBeaconMixin.js +85 -0
- package/sensor_classes/Beacon/Eddystone.js +77 -0
- package/sensor_classes/Beacon/iBeacon.js +58 -0
- package/sensor_classes/EctiveBMS.js +270 -0
- package/sensor_classes/FeasyComBeacon.js +68 -0
- package/sensor_classes/GobiusCTankMeter.js +4 -3
- package/sensor_classes/GoveeH5074.js +2 -0
- package/sensor_classes/GoveeH5075.js +2 -0
- package/sensor_classes/GoveeH510x.js +1 -0
- package/sensor_classes/Inkbird.js +1 -0
- package/sensor_classes/JBDBMS.js +1 -0
- package/sensor_classes/Junctek.js +14 -6
- package/sensor_classes/KilovaultHLXPlus.js +1 -0
- package/sensor_classes/LancolVoltageMeter.js +2 -0
- package/sensor_classes/MercurySmartcraft.js +1 -0
- package/sensor_classes/MopekaTankSensor.js +3 -200
- package/sensor_classes/RemoranWave3.js +2 -0
- package/sensor_classes/Renogy/RenogySensor.js +1 -0
- package/sensor_classes/RenogyBattery.js +3 -4
- package/sensor_classes/RenogyInverter.js +3 -6
- package/sensor_classes/RenogyRoverClient.js +3 -0
- package/sensor_classes/RuuviTag.js +6 -3
- package/sensor_classes/ShellySBDW002C.js +3 -1
- package/sensor_classes/ShellySBHT003C.js +7 -0
- package/sensor_classes/ShellySBMO003Z.js +3 -2
- package/sensor_classes/ShenzhenLiOnBMS.js +4 -0
- package/sensor_classes/SwitchBotMeterPlus.js +1 -1
- package/sensor_classes/SwitchBotTH.js +2 -1
- package/sensor_classes/UNKNOWN.js +2 -1
- package/sensor_classes/UltrasonicWindMeter.js +3 -0
- package/sensor_classes/Victron/VictronConstants.js +2 -0
- package/sensor_classes/Victron/VictronIdentifier.js +24 -0
- package/sensor_classes/Victron/VictronSensor.js +43 -54
- package/sensor_classes/VictronACCharger.js +1 -6
- package/sensor_classes/VictronBatteryMonitor.js +37 -26
- package/sensor_classes/VictronDCDCConverter.js +1 -4
- package/sensor_classes/VictronDCEnergyMeter.js +1 -4
- package/sensor_classes/VictronGXDevice.js +1 -4
- package/sensor_classes/VictronInverter.js +2 -3
- package/sensor_classes/VictronInverterRS.js +2 -4
- package/sensor_classes/VictronLynxSmartBMS.js +1 -4
- package/sensor_classes/VictronOrionXS.js +1 -3
- package/sensor_classes/VictronSmartBatteryProtect.js +1 -4
- package/sensor_classes/VictronSmartLithium.js +1 -4
- package/sensor_classes/VictronSolarCharger.js +1 -3
- package/sensor_classes/VictronVEBus.js +1 -4
- package/sensor_classes/XiaomiMiBeacon.js +5 -2
- package/sensor_classes/iBeaconSensor.js +40 -0
- package/src/components/PluginConfigurationPanel.js +53 -17
- package/Screenshot 2025-06-12 at 9.33.57/342/200/257AM.png +0 -0
- package/bt-sensors-plugin-sk copy.json +0 -170
- package/bt-sensors-plugin-sk.json.bak +0 -121
- package/diff.txt +0 -2860
- package/public/847.js +0 -1
- package/sensor_classes/IBeacon.js +0 -45
- package/vsl_patch_17_06_25.patch +0 -13
- /package/public/images/{Aranet2_HOME_F_900x900_90OVA5J.original.webp → Aranet2.webp} +0 -0
- /package/public/images/{Bank Manager All-in-onewc.webp → BankManager.webp} +0 -0
- /package/public/images/{Gobius_C.png → GobiusCTankMeter.png} +0 -0
- /package/public/images/{Victron-SmartShunt.jpg → VictronSmartShunt.jpg} +0 -0
- /package/public/images/{smartsolarMPPT7515.png → VictronSmartSolarMPPT7515.png} +0 -0
package/public/847.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunkbt_sensors_plugin_sk=self.webpackChunkbt_sensors_plugin_sk||[]).push([[847],{9337:()=>{},62995:(e,t,n)=>{"use strict";n.r(t),n.d(t,{BTConfig:()=>A,default:()=>k});var a=n(73490),s=n(74810),r=n(40334),o=n(86528),c=n.n(o),i=n(86452),l=n(27606),u=n(82096),m=n(3768),d=n(71431),g=n(39676),f=n(47041),p=n(86038),h=n(95027),E=n(43540),w=n(38250),y=n(31008),v=n(20455),S=n(23399);const b=e=>console.log.bind(console,e);function A(e){const t=(0,u.A)((e=>({root:{"& > *":{margin:e.spacing(1)}}}))),[n,A]=(0,o.useState)({}),[k,D]=(0,o.useState)({}),[C,x]=(0,o.useState)({}),[$,_]=(0,o.useState)({"ui:options":{label:!1},title:{"ui:widget":"hidden"}}),[T,N]=(0,o.useState)(),[O,j]=(0,o.useState)(new Map),[M,J]=(0,o.useState)({progress:0,maxTimeout:100,deviceCount:0,totalDevices:0}),[L,U]=(0,o.useState)("unknown"),[I,B]=(0,o.useState)(),P=t();function R(e,t){const n=new Headers;return n.append("Content-Type","application/json"),fetch(`/plugins/bt-sensors-plugin-sk/${e}`,{credentials:"include",method:"POST",body:JSON.stringify(t),headers:n})}async function G(e){var t;try{t=fetch(`/plugins/bt-sensors-plugin-sk/${e}`,{credentials:"include"})}catch(e){t={status:500,statusText:e.toString()}}return t}function H(e){return Object.keys(e.configCopy).length>0}function K(e){const t=H(e);return c().createElement(v.A,{action:!0,onClick:()=>{e.config.mac_address=e.info.mac,x(e.schema),N(e.config)}},c().createElement("div",{class:"d-flex justify-content-between align-items-center",style:t?{fontWeight:"normal"}:{fontStyle:"italic"}},`${e._changesMade?"*":""}${e.info.name} MAC: ${e.info.mac} RSSI: ${n=e.info.RSSI,null==n?NaN:n}`,c().createElement("div",{class:"d-flex justify-content-between "},function(e){return null==e.info.lastContactDelta||e.info.lastContactDelta>e.config.discoveryTimeout?c().createElement(m.A,null):e.info.signalStrength>80?c().createElement(d.A,null):e.info.signalStrength>60?c().createElement(g.A,null):e.info.signalStrength>40?c().createElement(f.A,null):e.info.signalStrength>20?c().createElement(p.A,null):c().createElement(h.A,null)}(e))));var n}function F(e){window.open(e,"_blank","noreferrer")}return(0,o.useEffect)((()=>{let e=null;return G("getPluginState").then((async t=>{if(404==t.status)throw U("unknown"),new Error("unable to get plugin state");const n=await t.json();e=new EventSource("/plugins/bt-sensors-plugin-sk/sse",{withCredentials:!0}),e.addEventListener("newsensor",(e=>{!function(e){let t=JSON.parse(e.data);console.log(`New sensor: ${t.info.mac}`),j((e=>(e.set(t.info.mac,t),new Map(e))))}(e)})),e.addEventListener("sensorchanged",(e=>{!function(e){console.log("sensorchanged");const t=JSON.parse(e.data);j((e=>{const n=e.get(t.mac);return n&&Object.assign(n.info,t),new Map(e)}))}(e)})),e.addEventListener("progress",(e=>{const t=JSON.parse(e.data);J(t)})),e.addEventListener("pluginstate",(e=>{const t=JSON.parse(e.data);U(t.state)})),U(n.state),(async()=>{const e=await async function(){const e=await G("getSensors");if(200!=e.status)throw new Error(`Unable get sensor data: ${e.statusText} (${e.status}) `);return await e.json()}();j(new Map(e.map((e=>[e.info.mac,e]))))})()})).catch((e=>{B(e)})),()=>{console.log("Closing connection to SSE"),e.close()}}),[]),(0,o.useEffect)((()=>{"started"==L?(async function(){const e=await G("getBaseData");if(200!=e.status)throw new Error(`Unable to get base data: ${e.statusText} (${e.status}) `);const t=await e.json();return t.schema.htmlDescription=c().createElement("div",null,(0,r.Ay)(t.schema.htmlDescription),c().createElement("p",null)),t}().then((e=>{A(e.schema),D(e.data)})).catch((e=>{B(e)})),async function(){const e=await G("getProgress");if(200!=e.status)throw new Error(`Unable to get progress: ${e.statusText} (${e.status}) `);return await e.json()}().then((e=>{J(e)})).catch((e=>{B(e)}))):(A({}),D({}))}),[L]),"stopped"==L||"unknown"==L?c().createElement("h3",null,"Enable plugin to see configuration"):c().createElement("div",null,c().createElement("div",{className:P.root},c().createElement(i.A,{variant:"contained",onClick:()=>{F("https://github.com/naugehyde/bt-sensors-plugin-sk/tree/1.2.0-beta#configuration")}},"Documentation"),c().createElement(i.A,{variant:"contained",onClick:()=>{F("https://github.com/naugehyde/bt-sensors-plugin-sk/issues/new/choose")}},"Report Issue"),c().createElement(i.A,{variant:"contained",onClick:()=>{F("https://discord.com/channels/1170433917761892493/1295425963466952725")}},"Discord Thread"),c().createElement("p",null),c().createElement("p",null)),c().createElement("hr",{style:{width:"100%",height:"1px",color:"gray","background-color":"gray","text-align":"left","margin-left":0}}),I?c().createElement("h2",{style:"color: red;"},I):"",c().createElement(a.Ay,{schema:n,validator:s.Ay,uiSchema:{"ui:field":"LayoutGridField","ui:layoutGrid":{"ui:row":[{"ui:row":{className:"row",children:[{"ui:columns":{className:"col-xs-4",children:["adapter","transport","duplicateData","discoveryTimeout","discoveryInterval"]}}]}}]}},onChange:e=>D(e.formData),onSubmit:({formData:e},t)=>{var n;n=e,j(new Map),R("updateBaseData",n).then((e=>{200!=e.status&&B(new Error(`Unable to update base data: ${e.statusText} (${e.status})`))})),x({})},onError:b("errors"),formData:k}),c().createElement("hr",{style:{width:"100%",height:"1px",color:"gray","background-color":"gray","text-align":"left","margin-left":0}}),c().createElement("p",null),c().createElement("p",null),M.deviceCount<M.totalDevices?c().createElement(S.A,{max:M.maxTimeout,now:M.progress}):"",c().createElement("p",null),c().createElement(w.A,{defaultActiveKey:"_configured",id:"domain-tabs",className:"mb-3"},function(){const e=[...new Set(O.entries().map((e=>e[1].info.domain)))].sort(),t=Array.from(O.entries()).filter((e=>H(e[1])));let n={};return n._configured=0==t.length?"Select a device from its domain tab (Electrical etc.) and configure it.":t.map((e=>K(O.get(e[0])))),e.forEach((e=>{var t;n[e]=(t=e,Array.from(O.entries()).filter((e=>e[1].info.domain===t))).map((e=>K(O.get(e[0]))))})),Object.keys(n).map((e=>function(e,t){let n=e.slice("_"===e.charAt(0)?1:0);return c().createElement(y.A,{eventKey:e,title:`${n.charAt(0).toUpperCase()}${n.slice(1)}${"string"==typeof t?"":" ("+t.length+")"}`},c().createElement(E.A,{style:{maxHeight:"300px",overflowY:"auto"}},t))}(e,n[e])))}()),c().createElement("div",{style:{paddingLeft:10,paddingTop:10,display:0==Object.keys(C).length?"none":""}},c().createElement(l.A,{container:!0,direction:"column",style:{spacing:5}},c().createElement(l.A,{item:!0},c().createElement("h2",null,C?.title),c().createElement("p",null)),c().createElement(l.A,{item:!0},(0,r.Ay)(C?.htmlDescription))),c().createElement(a.Ay,{schema:C,validator:s.Ay,uiSchema:$,onChange:e=>{const t=O.get(e.formData.mac_address);t&&(t._changesMade=!0,t.config=e.formData,N(e.formData))},onSubmit:({formData:e},t)=>{var n;R("updateSensorData",n=e).then((e=>{if(200!=e.status)throw new Error(e.statusText);j((e=>(e.delete(n.mac_address),new Map(e)))),x({})})),alert("Changes saved")},onError:b("errors"),formData:T},c().createElement("div",{className:P.root},c().createElement(i.A,{type:"submit",color:"primary",variant:"contained"},"Save"),c().createElement(i.A,{variant:"contained",onClick:()=>{var e;e=T.mac_address,O.get(e)._changesMade=!1,O.get(e).config=JSON.parse(JSON.stringify(O.get(e).configCopy)),N(O.get(e).config)}},"Undo"),c().createElement(i.A,{variant:"contained",color:"secondary",onClick:e=>function(e){const t=O.get(e);(!H(t)||window.confirm(`Delete configuration for ${t.info.name}?`))&&function(e){try{R("removeSensorData",{mac_address:e}).then((e=>{if(200!=e.status)throw new Error(e.statusText)})),j((t=>(t.delete(e),new Map(t)))),x({})}catch{}}(e)}(T.mac_address)},"Delete")))))}const k=A}}]);
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
const BTSensor = require("../BTSensor");
|
|
2
|
-
|
|
3
|
-
class IBeacon extends BTSensor {
|
|
4
|
-
static isSystem = true;
|
|
5
|
-
|
|
6
|
-
static async identify(device) {
|
|
7
|
-
/*const md = await this.getDeviceProp(device,'ManufacturerData');
|
|
8
|
-
if (md && Object.hasOwn(md, 0x004c)) {
|
|
9
|
-
if (md[0x004c].value.slice(0,2).join() == [0x02, 0x15].join()) {
|
|
10
|
-
return this
|
|
11
|
-
}
|
|
12
|
-
}*/
|
|
13
|
-
// IBeacon protocol (see above) is incorporated into multiple BT devices
|
|
14
|
-
// The identify:: method above will misidentify any sensor (Govee for example)
|
|
15
|
-
// that the scanner finds.
|
|
16
|
-
// Sensors can still be classified as IBeacons, they'll appear as Unknown devices in
|
|
17
|
-
// the config. Users can then select IBeacon from the dropdown to
|
|
18
|
-
// instantiate the sensor as an IBeacon object.
|
|
19
|
-
|
|
20
|
-
return null
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
initSchema(){
|
|
24
|
-
super.initSchema()
|
|
25
|
-
this.addDefaultPath("battery","sensors.batteryStrength")
|
|
26
|
-
.read=(buffer)=>{return buffer[6]}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
propertiesChanged(props){
|
|
30
|
-
super.propertiesChanged(props);
|
|
31
|
-
const buff = this.getServiceData("0000356e-0000-1000-8000-00805f9b34fb");
|
|
32
|
-
if (buff)
|
|
33
|
-
this.emitData("battery", buff);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
getManufacturer(){
|
|
37
|
-
return "Apple Inc. or clone";
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
getDescription(){
|
|
41
|
-
return `${this.getName()} iBeacon from Apple Inc. or a clone`
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
module.exports = IBeacon;
|
package/vsl_patch_17_06_25.patch
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
diff --git a/sensor_classes/VictronSmartLithium.js b/sensor_classes/VictronSmartLithium.js
|
|
2
|
-
index 0ed70ad..2988374 100644
|
|
3
|
-
--- a/sensor_classes/VictronSmartLithium.js
|
|
4
|
-
+++ b/sensor_classes/VictronSmartLithium.js
|
|
5
|
-
@@ -50,7 +50,7 @@ class VictronSmartLithium extends VictronSensor{
|
|
6
|
-
(buff)=>{return buff.readUInt16LE(4)})
|
|
7
|
-
.default="electrical.batteries.{batteryID}.errors"
|
|
8
|
-
|
|
9
|
-
- for (let i=0;i++;i<8){
|
|
10
|
-
+ for (let i=0;i<8; i++){
|
|
11
|
-
this.addMetadatum(`cell${i+1}Voltage`,'V', `cell ${i+1} voltage`)
|
|
12
|
-
.default=`electrical.batteries.{batteryID}.cell${i+1}.voltage`
|
|
13
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|