panasonic-comfort-cloud-client
v2.2.0
Published
[](https://www.npmjs.com/package/panasonic-comfort-cloud-client) [Login to Panasonic Comfort Cloud with username and password will return a random token. This token is stored internally in a variable and sent with every request.
Groups and Devices
import {
Device,
Group,
ComfortCloudClient,
} from 'panasonic-comfort-cloud-client'
await client.login(username, password)
// List of groups representing different homes, containing a list of devices
const groups = await client.getGroups()
// Get device by guid. Containing readable and writable properties.
const device = await comfortCloudClient.getDevice(guid)Writable properties of device
import {
Device,
ComfortCloudClient,
//enums for writable properties
Power,
AirSwingLR,
AirSwingUD,
FanAutoMode,
EcoMode,
OperationMode,
FanSpeed,
} from 'panasonic-comfort-cloud-client'
await client.login(username, password)
const device = await comfortCloudClient.getDevice(guid)
// writable properties of device. Use the enums for the correct numbers.
device.operate = Power.On
device.operationMode = OperationMode.Auto
device.ecoMode = EcoMode.Auto
device.temperatureSet = 22
device.airSwingUD = AirSwingUD.Mid
device.airSwingLR = AirSwingLR.Mid
device.fanAutoMode = FanAutoMode.AirSwingAuto
device.fanSpeed = FanSpeed.Auto
// use parameter setter to send specific properties or use the device setter to send all parameter
await comfortCloudClient.setParameters(device.guid, device.parameters)
await comfortCloudClient.setDevice(device)History Data
import {
ComfortCloudClient,
DataMode
} from 'panasonic-comfort-cloud-client'
// ... login ...
// Get history data for specific device (Day, Week, Month, Year)
const history = await client.getDeviceHistoryData(device.guid, new Date(), DataMode.Day)CLI
The package comes with a command line interface to control your devices or debug the API.
$ comfort-cloud-client-clior if you haven't installed it globally:
$ npx panasonic-comfort-cloud-clientFollow the interactive prompts to login and control your devices.
Usage Example
? App Version (default: 1.20.0) 1.21.0
? Username [email protected]
? Password [hidden]
Login successful.
? Select a package manager Get groups
Found 1 groups.
? Select a group My Home
Found 2 devices.
? Select a device or print group Living Room AC
? Select command for device Living Room AC. Get history
? Select data mode Day
{
"energyConsumptionHeating": 0,
"energyConsumptionCooling": 2.5,
...
}Changelog
See CHANGELOG.md for details on all release history.
