A battery reports how much charge is left, whether it is charging or discharging, how many hours it has to go, and how warm it is. Home Assistant and Alexa integration through Node-RED lets you ask for any of these out loud, so a solar bank, a power bank or a UPS answers without opening an app.
The following is a sample Node-RED output for this device using default component values:
{
"id": "{--Battery Device ID--}",
"name": "{--Battery Device Name--}",
"type": "battery",
"components": {
"RangeController:Battery.Level": {
"rangeValue": 0
},
"ModeController:Battery.State": {
"mode": "State.Idle"
},
"RangeController:Battery.TimeToGo": {
"rangeValue": 0
},
"RangeController:Battery.Temperature": {
"rangeValue": 20
}
},
"metadata": {
"previous": {
"components": {
...
}
}
}
}This device reports values that Alexa can only be asked about. Send them to the hub node from your flow, and Alexa reads back whatever arrived last:
{
"id": "{--Battery Device ID--}",
"components": {
"RangeController:Battery.Level": {
"rangeValue": 0
},
"ModeController:Battery.State": {
"mode": "State.Idle"
},
"RangeController:Battery.TimeToGo": {
"rangeValue": 0
},
"RangeController:Battery.Temperature": {
"rangeValue": 20
}
}
}The following components enable various features and controls for this device. Each component offers specific capabilities, commands, and configurations to enhance your Node-RED Alexa integration.
The Battery.Level instance reports the state of charge as a percentage.
Alexa can only ask about this value, never set it. Your flow keeps it up to date by sending it to the hub node.
Commands:
“Alexa, what's the power bank level?”
“Alexa, what's the battery level on the power bank?”
“Alexa, what's the power bank charge?”
Specification:
| Property | Description | Allowed Values | Default |
|---|---|---|---|
| rangeValue | Specifies the range value for the device (e.g., fan speed or lift height). | 0 - 100 | 0 |
The Battery.State instance reports whether the battery is idle, charging, discharging or full.
Alexa can only ask about this value, never set it. Your flow keeps it up to date by sending it to the hub node.
Commands:
“Alexa, what's the power bank charging state?”
“Alexa, what's the charging state on the power bank?”
“Alexa, what's the power bank state?”
Specification:
| Property | Description | Allowed Values | Default |
|---|---|---|---|
| mode | Sets the operational mode of the device (e.g., garage door position). | State.Idle, State.Charging, State.Discharging, State.Full | State.Idle |
The Battery.TimeToGo instance reports how long the battery has left, in hours. Alexa has no unit for time, so the number is spoken on its own and the unit lives in the name you ask for.
Alexa can only ask about this value, never set it. Your flow keeps it up to date by sending it to the hub node.
Commands:
“Alexa, what's the power bank hours remaining?”
“Alexa, what's the hours remaining on the power bank?”
“Alexa, what's the power bank hours left?”
Specification:
| Property | Description | Allowed Values | Default |
|---|---|---|---|
| rangeValue | Specifies the range value for the device (e.g., fan speed or lift height). | 0 - 99 | 0 |
The Battery.Temperature instance reports the temperature of the cells in Celsius, which matters for lithium batteries that should not be charged below freezing.
Alexa can only ask about this value, never set it. Your flow keeps it up to date by sending it to the hub node.
Commands:
“Alexa, what's the power bank temperature?”
“Alexa, what's the battery temperature on the power bank?”
Specification:
| Property | Description | Allowed Values | Default |
|---|---|---|---|
| rangeValue | Specifies the range value for the device (e.g., fan speed or lift height). | -20 - 60 | 20 |