A NodeJS server which accepts REST commands and configures Mitsubishi Airconditioners that use Kumo Gateway
>npm install kumojs
You will need to create a kumo.cfg file for any of the commands to work
>kumoconfig
this will create the kumo.cfg file that is needed for all the later commandsa
after install cli can be accessed by running "kumo"
>kumo help
will show the different options CLI is described in detail in the later part of the readme
To start the server run
>kumoserver
npm install
npm run build
This step is important step, this is what creates the configuraiton file that has all the information about the units. The CLI mode and the server mode will use this file to work. When you run this, the script connects to the cloud and downloads the configuration. (Hopefully This is not going to be disabled by the cloud folks). The download files will be stored in kumo.cfg
> npm run config
> cp kumo.cfg build/
This command will run a rest server that will accept commands by listining to a http port and sending those commands to the airconditioner
npm run server
Detail on how to run in server mode and all the API's are provided later in the document.
npm run cmd show config
Detail on how to run in cli mode and all the commands are provided later in the document.
Build the container
> cp build/kumo.cfg docker/
> cd docker
> ./build_kumojs
docker run --net=host -d --name kumojs --restart unless-stopped --tmpfs /run --tmpfs /run/lock sushilks/kumojs /bin/bash -c ". /root/.nvm/nvm.sh && /root/run_kumojs.sh"
./attach_kumojs
docker logs -f kumojs
in cli mode you can send a command to the air-conditioner form the shell.
> npm run cmd help
or
> kumo help
usage: kumoCmd.js room <room> mode ( off | heat | cool | dry )
kumoCmd.js room <room> fan ( quiet | low | powerful )
kumoCmd.js room <room> vent [ auto | horizontal | midhorizontal | midpoint | midvertical | vertical | swing ]
kumoCmd.js room <room> status
kumoCmd.js room <room> cool temp <temp>
kumoCmd.js room <room> heat temp <temp>
kumoCmd.js show [config]
> npm run cmd show config
Account Address Label
Acc:[email protected] address:192.168.2.20 label:Master Bedroom
Acc:[email protected] address:192.168.2.21 label:Kids Room
Acc:[email protected] address:192.168.2.22 label:Guest Room
> npm run cmd room 'Guest Room' status
Status: {"r":{"indoorUnit":{"status":{"roomTemp":19.5,"mode":"off","spCool":25.5,
"spHeat":22.5,"vaneDir":"vertical","fanSpeed":"quiet","tempSource":"unset","activeThermistor":"unset",
"filterDirty":false,"hotAdjust":false,"defrost":false,"standby":false,"runTest":0}}}}
> npm run cmd room 'Guest Room' mode cool
{"r":{"indoorUnit":{"status":{"mode":"off"}}}}
> npm run cmd room 'Guest Room' fan powerful
> npm run cmd room 'Guest Room' mode off
Start the server
> npm run server
App is running on port: 8084
> curl http://127.0.0.1:8084/v0/rooms
["Guest Room","Master Bedroom","Kids Room"]
> curl http://127.0.0.1:8084/v0/room/Guest%20Room/status
{"r":{"indoorUnit":{"status":{"roomTemp":23.333334,"mode":"off","spCool":25.5,"spHeat":22.5,
"vaneDir":"horizontal","fanSpeed":"powerful","tempSource":"unset","activeThermistor":"unset",
"filterDirty":false,"hotAdjust":false,"defrost":false,"standby":false,"runTest":0}}}}
> curl -XPUT http://127.0.0.1:8084/v0/room/Guest%20Room/mode/cool
{"r":{"indoorUnit":{"status":{"mode":"off"}}}}
> curl -XPUT http://127.0.0.1:8084/v0/room/Guest%20Room/speed/powerful
{"r":{"indoorUnit":{"status":{"fanSpeed":"powerful"}}}}
curl -XPUT http://127.0.0.1:8084/v0/room/Guest%20Room/vent/swing
{"r":{"indoorUnit":{"status":{"vaneDir":"horizontal"}}}}
> curl -XPUT http://127.0.0.1:8084/v0/room/Guest%20Room/cool/temp/68
{"r":{"indoorUnit":{"status":{"spCool":20}}}}
> curl -XPUT http://127.0.0.1:8084/v0/room/Guest%20Room/heat/temp/68
{"r":{"indoorUnit":{"status":{"spHeat":20}}}}