npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

kumojs

v0.1.3

Published

Api Gateway and Controller for Mitsubishi Airconditioners

Downloads

23

Readme

kumojs

A NodeJS server which accepts REST commands and configures Mitsubishi Airconditioners that use Kumo Gateway

To install run.

>npm install kumojs

You will need to create a kumo.cfg file for any of the commands to work

configuration

>kumoconfig

this will create the kumo.cfg file that is needed for all the later commandsa

cli

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

Server

To start the server run

>kumoserver

TO Work with the Souce Repository.

TO setup build env and packages


npm install

TO BUILD


npm run build

To setup you configuraiton file.


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/

To start SERVER


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.

To run in cli mode


npm run cmd show config

Detail on how to run in cli mode and all the commands are provided later in the document.

To create a container to run the package use the docker directory


Build the container

> cp build/kumo.cfg docker/
> cd docker
> ./build_kumojs

to run the container (I Use shared namespace in my case)


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"

To attach to the running container


./attach_kumojs

To view the logs from the container


docker logs -f kumojs

Usages in CLI Mode


in cli mode you can send a command to the air-conditioner form the shell.

Help

> 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]

To see the configuration file i.e. all the rooms and address

> 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

Get the status of one of the air con

> 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}}}}

Turn on one of the air conditioner to cool

> npm run cmd room 'Guest Room' mode cool
{"r":{"indoorUnit":{"status":{"mode":"off"}}}}

to change the fan speed in the guest room

> npm run cmd room 'Guest Room' fan powerful

Turn off the air conditioner to cool in Guest room

> npm run cmd room 'Guest Room' mode off

Usages when running as an API server


Start the server

> npm run server
App is running on port: 8084

Get a list of rooms

> curl http://127.0.0.1:8084/v0/rooms
["Guest Room","Master Bedroom","Kids Room"]

Get the status of Guest 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}}}}

Start the guest room Aircon in cooling mode

> curl -XPUT http://127.0.0.1:8084/v0/room/Guest%20Room/mode/cool
{"r":{"indoorUnit":{"status":{"mode":"off"}}}}

Change the fan speed

> curl -XPUT http://127.0.0.1:8084/v0/room/Guest%20Room/speed/powerful
{"r":{"indoorUnit":{"status":{"fanSpeed":"powerful"}}}}

Change the vent setting

curl -XPUT http://127.0.0.1:8084/v0/room/Guest%20Room/vent/swing
{"r":{"indoorUnit":{"status":{"vaneDir":"horizontal"}}}}

change the temperature for cooling

> curl -XPUT http://127.0.0.1:8084/v0/room/Guest%20Room/cool/temp/68
{"r":{"indoorUnit":{"status":{"spCool":20}}}}

change the temperature for heating

> curl -XPUT http://127.0.0.1:8084/v0/room/Guest%20Room/heat/temp/68
 {"r":{"indoorUnit":{"status":{"spHeat":20}}}}

TODO