lucavb / esphome-ts Goto Github PK
View Code? Open in Web Editor NEWTypeScript client for the Esphome Native API interface
License: GNU General Public License v3.0
TypeScript client for the Esphome Native API interface
License: GNU General Public License v3.0
Is there a plan to merge the Fan component to the main branch? This need to be done to bring it into Homebridge Esphome Ts
So I've been sifting through the code and it seems like there is no output for color-mode being sent to esphome from homebridge. I use HomeKit and it requires a color mode to be sent for it to be able to switch to white from rgb colors. Instead it sends "white" in rgb values.
this is a log from the esphome device:
[16:25:45][VV][api.service:617]: on_light_command_request: LightCommandRequest {
key: 2880471878
has_state: YES
state: YES
has_brightness: YES
brightness: 0.78
has_color_mode: NO
color_mode: COLOR_MODE_UNKNOWN
has_color_brightness: NO
color_brightness: 0
has_rgb: YES
red: 1
green: 0.239216
blue: 0.976471
has_white: NO
white: 0
has_color_temperature: NO
color_temperature: 0
has_cold_white: NO
cold_white: 0
has_warm_white: NO
warm_white: 0
and this is what it responds with after:
[16:25:45][I][light:392]: 'studio-posters' - Keeping current color mode RGB for call without color mode.
[16:25:45][D][light:036]: 'studio-posters' Setting:
[16:25:45][D][light:051]: Brightness: 78%
[16:25:45][D][light:058]: Red: 100%, Green: 24%, Blue: 98%
[16:25:45][D][light:085]: Transition length: 1.0s
[16:25:45][VV][api.service:122]: send_light_state_response: LightStateResponse {
key: 2880471878
state: YES
brightness: 0.78
color_mode: COLOR_MODE_RGB
color_brightness: 1
red: 1
green: 0.239216
blue: 0.976471
white: 1
color_temperature: 0
cold_white: 1
warm_white: 1
effect: ''
}
My yaml file is this: (This could not be fully correct because I was messing with it after I had already uploaded to my light)
substitutions:
devicename: studio-posters
device_name: Studio Posters
esphome:
name: $devicename
esp8266:
board: esp01_1m
logger:
level: VERY_VERBOSE
api:
password: ""
ota:
password: ""
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
power_save_mode: light
ap:
ssid: "$devicename Fallback Hotspot"
password: "iH0ebRQ9vEyv"
captive_portal:
light:
switch:
sensor:
#script:
output:
I programed a device with two switches: one is a typical GPIO switch, the other is a virtual (platform) switch. esphome log shows the following:
[19:52:55][C][gpio.output:010]: GPIO Binary Output:
[19:52:55][C][gpio.output:011]: Pin: GPIO5 (Mode: OUTPUT, INVERTED)
[19:52:55][C][switch.gpio:048]: GPIO Switch 'gpio switch'
[19:52:55][C][switch.gpio:049]: Pin: GPIO12 (Mode: OUTPUT)
[19:52:55][C][switch.gpio:071]: Restore Mode: Restore (Defaults to OFF)
[19:52:55][C][template.switch:058]: Template Switch 'virtual switch'
[19:52:55][C][template.switch:059]: Restore State: NO
[19:52:55][C][template.switch:060]: Optimistic: NO
esphome-ts found the GPIO switch and is able to control it as expected. However, esphome-ts didn't "see" the virtual switch. Is this normal?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.