Get the visible home(s) power consumption.
Get-TibberConsumption [-Resolution <String>] [-From <DateTime>] [-To <DateTime>] [-Last <Int32>]
[-FilterEmptyNodes] [-Fields <String[]>] [-PersonalAccessToken <String>] [-UserAgent <String>] [-Force]
[-DebugResponse] [<CommonParameters>]
Get-TibberConsumption -HomeId <String> [-Resolution <String>] [-From <DateTime>] [-To <DateTime>]
[-Last <Int32>] [-FilterEmptyNodes] [-Fields <String[]>] [-PersonalAccessToken <String>] [-UserAgent <String>]
[-Force] [-DebugResponse] [<CommonParameters>]
Get-TibberConsumption [-Resolution <String>] [-From <DateTime>] [-To <DateTime>] [-Last <Int32>]
[-FilterEmptyNodes] [-Fields <String[]>] [-URI <Uri>] [-PersonalAccessToken <String>] [-UserAgent <String>]
[-Force] [-DebugResponse] [<CommonParameters>]
Calling this function will return the visible home(s) power consumption.
$response = Get-TibberConsumption -Last 10
$maxCons = $response | Sort-Object -Property consumption -Descending | Select-Object -First 1
Write-Host "Max power consumption $($maxCons.cost) $($maxCons.currency) ($($maxCons.consumption) $($maxCons.consumptionUnit) at $($maxCons.unitPrice)): $(([DateTime]$maxCons.from).ToString('HH:mm')) - $(([DateTime]$maxCons.to).ToString('HH:mm on yyyy-MM-dd'))"
Get-TibberConsumption -From ([DateTime]::Now).AddHours(-10)
Specifies the home Id, e.g. '96a14971-525a-4420-aae9-e5aedaa129ff'.
Type: String
Parameter Sets: HomeId
Aliases: Id
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies the resoluton of the results.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: HOURLY
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies the start date for nodes to include in results.
Type: DateTime
Parameter Sets: (All)
Aliases: After, Start
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies the end date for nodes to include in results. Providing a date only, e.g. '2023-10-31', will set the time to 23:59:59.
Type: DateTime
Parameter Sets: (All)
Aliases: End
Required: False
Position: Named
Default value: [DateTime]::Now
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies the number of nodes to include in results, counting back from the latest entry.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 1
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Switch to filter out empty nodes (i.e. consumption is '0') from results.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Specifies the fields to return.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: @(
'from'
'to'
'unitPrice'
'unitPriceVAT'
'consumption'
'consumptionUnit'
'cost'
'currency'
)
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
{{ Fill DebugResponse Description }}
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill Force Description }}
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill PersonalAccessToken Description }}
Type: String
Parameter Sets: (All)
Aliases: PAT, AccessToken, Token
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill URI Description }}
Type: Uri
Parameter Sets: URI
Aliases: URL
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill UserAgent Description }}
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.