Skip to content

Commit

Permalink
feat(asset_tracker_v2+AWS): add solar shield data
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Nov 6, 2023
1 parent e5bd17e commit 73b73e8
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lwm2m/14210.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ export type SolarCharge_14210 = LwM2MObject & {
* The current gain from the solar shield, measured in mA. Example: 3.123, -0.0032.
*/
0: number
/**
* Voltage (V)
*
* CDATA[Battery voltage in Volt. Examples: 2.754, 3.3.
*/
1?: number
/**
* Timestamp (Time)
*
Expand Down
10 changes: 10 additions & 0 deletions lwm2m/14210.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@
<Units>mA</Units>
<Description><![CDATA[The current gain from the solar shield, measured in mA. Example: 3.123, -0.0032.]]></Description>
</Item>
<Item ID="1">
<Name>Voltage</Name>
<Operations>R</Operations>
<MultipleInstances>Single</MultipleInstances>
<Mandatory>Optional</Mandatory>
<Type>Float</Type>
<RangeEnumeration/>
<Units>V</Units>
<Description><![CDATA[Battery voltage in Volt. Examples: 2.754, 3.3.]]></Description>
</Item>
<Item ID="99">
<Name>Timestamp</Name>
<Operations>R</Operations>
Expand Down
58 changes: 58 additions & 0 deletions models/asset_tracker_v2+AWS/transformers/solar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
type: shadow
---

# Solar shield

Data from the solar shield:
https://www.nordicsemi.com/Nordic-news/2023/08/exegers-powerfoyle-shield-enables-unlimited-battery-life-in-development-projects-using-thingy91

## Match Expression

```jsonata
$exists(state.reported.sol)
```

## Transform Expression

```jsonata
[
{"bn": 14210, "n": 0, "v": state.reported.sol.v.gain, "bt": state.reported.sol.ts },
{"n": 1, "v": state.reported.sol.v.bat }
]
```

## Input Example

```json
{
"state": {
"reported": {
"sol": {
"v": {
"gain": 4.391489028930664,
"bat": 3.872000217437744
},
"ts": 1699050063028
}
}
}
}
```

## Result Example

```json
[
{
"bn": 14210,
"n": 0,
"v": 4.391489028930664,
"bt": 1699050063028
},
{
"n": 1,
"v": 3.872000217437744
}
]
```

0 comments on commit 73b73e8

Please sign in to comment.