Skip to content

Instantly share code, notes, and snippets.

@grischard
Last active November 30, 2020 23:53
Show Gist options
  • Save grischard/f54ac75f3b5ced669cdf75f9f405aea1 to your computer and use it in GitHub Desktop.
Save grischard/f54ac75f3b5ced669cdf75f9f405aea1 to your computer and use it in GitHub Desktop.
[17:01:45][D][binary_sensor:036]: 'button_up': Sending state ON
[17:01:45][VV][preferences:051]: SAVE 34: 0=0x00000001 1=0x00000000 (Type=1183803264, CRC=0x0994DB5C)
[17:01:45][VV][api.service:077]: send_fan_state_response: FanStateResponse {
[17:01:45] key: 1183803264
[17:01:45] state: YES
[17:01:45] oscillating: NO
[17:01:45] speed: FAN_SPEED_LOW
[17:01:45] direction: FAN_DIRECTION_FORWARD
[17:01:45]}
[17:01:45][D][main:495]: Fan raised to Low
[17:01:45][D][speed.fan:039]: Setting speed: 0.33
[17:01:45][D][switch:025]: 'fan_med' Turning OFF.
[17:01:45][D][switch:025]: 'fan_high' Turning OFF.
[17:01:45][D][switch:021]: 'fan_low' Turning ON.
[17:01:45][D][switch:045]: 'fan_low': Sending state ON
[17:01:45][VV][scheduler:026]: set_timeout(name='OFF', timeout=50)
[17:01:45][VV][scheduler:152]: Running timeout 'OFF' with interval=50 last_execution=46911 (now=46961)
[17:01:45][D][binary_sensor:036]: 'button_up': Sending state OFF
[17:01:51][VV][scheduler:026]: set_timeout(name='ON', timeout=100)
[17:01:51][VV][scheduler:152]: Running timeout 'ON' with interval=100 last_execution=52684 (now=52784)
[17:01:51][D][binary_sensor:036]: 'button_down': Sending state ON
[17:01:51][VV][preferences:051]: SAVE 34: 0=0x00000000 1=0x00000000 (Type=1183803264, CRC=0x468F6780)
[17:01:51][VV][api.service:077]: send_fan_state_response: FanStateResponse {
[17:01:51] key: 1183803264
[17:01:51] state: NO
[17:01:51] oscillating: NO
[17:01:51] speed: FAN_SPEED_LOW
[17:01:51] direction: FAN_DIRECTION_FORWARD
[17:01:51]}
[17:01:51][D][main:523]: Fan lowered to Zero
[17:01:51][D][speed.fan:039]: Setting speed: 0.00
atal exception 3(LoadStoreErrorCause):urning OFF.
[17:01:51]epc1=0x40225d1c, epc2=0x00000000, epc3=0x00000000, excvaddr=0x40224e24, depc=0x00000000
INFO Need to fetch platformio IDE-data, please stand by
INFO Running: platformio run -d smarthotte -t idedata
WARNING Decoded 0x40225d1c: esphome::api::SwitchStateResponse::decode_varint(unsigned int, esphome::api::ProtoVarInt)
[17:01:54]
[17:01:54]--------------- CUT HERE FOR EXCEPTION DECODER ---------------
[17:01:54]
[17:01:54]Exception (3):
WARNING Exception type: unknown
[17:01:54]epc1=0x40225d1c epc2=0x00000000 epc3=0x00000000 excvaddr=0x40224e24 depc=0x00000000
WARNING Decoded 0x40225d1c: esphome::api::SwitchStateResponse::decode_varint(unsigned int, esphome::api::ProtoVarInt)
[17:01:54]
[17:01:54]>>>stack>>>
WARNING Found stack trace! Trying to decode it
[17:01:54]
[17:01:54]ctx: cont
[17:01:54]sp: 3ffffb70 end: 3fffffc0 offset: 0190
[17:01:54]3ffffd00: 00000001 000001e9 3fff1f04 4022be4c
WARNING Decoded 0x4022be4c: vsnprintf at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/vsnprintf.c:42
[17:01:54]3ffffd10: 3fff1fa3 00000000 006d305b 40224ef9
WARNING Decoded 0x40224ef9: uart_write
[17:01:54]3ffffd20: 3fff1fa2 00000000 3fff5b6c 3ffe86db
[17:01:54]3ffffd30: 00000005 3fff276c 00000020 3ffe86db
[17:01:54]3ffffd40: 4022134c 3fff0f1c 3fff1f6b 40221358
WARNING Decoded 0x4022134c: HardwareSerial::write(unsigned char const*, unsigned int)
WARNING Decoded 0x40221358: HardwareSerial::write(unsigned char const*, unsigned int)
[17:01:54]3ffffd50: 4022134c 3fff0f1c 3fff1f6b 4022178d
WARNING Decoded 0x4022134c: HardwareSerial::write(unsigned char const*, unsigned int)
WARNING Decoded 0x4022178d: Print::write(char const*)
[17:01:54]3ffffd60: 00000005 3fff1f6b 3fff0f1c 40221a79
WARNING Decoded 0x40221a79: Print::println(char const*)
[17:01:54]3ffffd70: 3fff1f66 3fff1f6b 3fff1f04 40208e9c
WARNING Decoded 0x40208e9c: esphome::logger::Logger::log_message_(int, char const*, int)
[17:01:54]3ffffd80: 3ffe86db 0000002d 00000000 40208d92
WARNING Decoded 0x40208d92: esphome::logger::Logger::vprintf_to_buffer_(char const*, __va_list_tag)
[17:01:54]3ffffd90: 3ffffe30 3ffffe20 00000010 3ffe86db
[17:01:54]3ffffda0: 00000005 00000017 3fff1f04 40209014
WARNING Decoded 0x40209014: esphome::logger::Logger::log_vprintf_(int, char const*, int, __FlashStringHelper const*, __va_list_tag)
[17:01:54]3ffffdb0: 0000002d 4025fd6c 3fff4f14 00000000
WARNING Decoded 0x4025fd6c: chip_v6_unset_chanfreq
[17:01:54]3ffffdc0: 00000000 00000000 00000020 00000000
[17:01:54]3ffffdd0: 3fff2820 00000000 3fff27f4 40211144
WARNING Decoded 0x40211144: esphome::esp_log_vprintf_(int, char const*, int, __FlashStringHelper const*, __va_list_tag)
[17:01:54]3ffffde0: 3ffffe30 3ffffe20 00000010 40101278
WARNING Decoded 0x40101278: umm_poison_free_fl
[17:01:54]3ffffdf0: 00000005 3ffe99d0 00000009 40211170
WARNING Decoded 0x40211170: esphome::esp_log_printf_(int, char const*, int, __FlashStringHelper const*, ...)
[17:01:54]3ffffe00: 3ffffe30 3ffffe20 00000010 4022ffd1
WARNING Decoded 0x4022ffd1: operator delete(void*) at /workdir/repo/gcc/libstdc++-v3/libsupc++/del_op.cc:48
[17:01:54]3ffffe10: 3ffffe30 3ffffe20 00000010 402301b8
WARNING Decoded 0x402301b8: std::string::_Rep::_M_destroy(std::allocator<char> const&) at /workdir/arena.x86_64/gcc/xtensa-lx106-elf/libstdc++-v3/include/bits/basic_string.tcc:452
[17:01:54]3ffffe20: 00000000 00000000 3fff27f4 402301da
WARNING Decoded 0x402301da: std::string::_Rep::_M_dispose(std::allocator<char> const&) at /workdir/arena.x86_64/gcc/xtensa-lx106-elf/libstdc++-v3/include/bits/basic_string.h:254
[17:01:54]3ffffe30: 3fff2b58 3ffe9a14 3fff27f4 402301f6
WARNING Decoded 0x402301f6: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() at /workdir/arena.x86_64/gcc/xtensa-lx106-elf/libstdc++-v3/include/bits/basic_string.h:541
[17:01:54]3ffffe40: 3ffffe70 3fff276c 3fff1f68 4020a3a4
WARNING Decoded 0x4020a3a4: esphome::switch_::Switch::publish_state(bool)
[17:01:54]3ffffe50: 00000000 00000000 3fff27f4 40207e12
WARNING Decoded 0x40207e12: esphome::gpio::GPIOSwitch::write_state(bool)
[17:01:54]3ffffe60: 3fff4f28 3ffffe70 00000010 40208d92
WARNING Decoded 0x40208d92: esphome::logger::Logger::vprintf_to_buffer_(char const*, __va_list_tag)
[17:01:54]3ffffe70: 3fffff10 3fffff00 00000010 3ffe9baa
[17:01:54]3ffffe80: 3fff2b58 3fd47ae1 3fff1f04 00000000
[17:01:54]3ffffe90: 00000000 00000000 3fff27f4 4020a25c
WARNING Decoded 0x4020a25c: esphome::switch_::Switch::turn_off()
[17:01:54]3ffffea0: 00000000 40211608 3fff30ec 40211fa4
WARNING Decoded 0x40211608: esphome::Scheduler::SchedulerItem::cmp(std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> > const&, std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> > const&)
WARNING Decoded 0x40211fa4: esphome::switch_::TurnOffAction<float>::play(float)
[17:01:54]3ffffeb0: 00000000 3ffe9baa 3fff310c 40212853
WARNING Decoded 0x40212853: esphome::Action<float>::play_complex(float)
[17:01:54]3ffffec0: 3fffff10 00000000 3fff2f8c 402267f8
WARNING Decoded 0x402267f8: esphome::ActionList<float>::play(float)
[17:01:54]3ffffed0: 00000000 3fff385c 3fff0c60 40213b1d
WARNING Decoded 0x40213b1d: esphome::IfAction<float>::play_complex(float)
[17:01:54]3ffffee0: 3fffff10 3f800000 3fff267c 402267f8
WARNING Decoded 0x402267f8: esphome::ActionList<float>::play(float)
[17:01:54]3ffffef0: 3fffff10 3fffff00 00000010 40213b38
WARNING Decoded 0x40213b38: esphome::template_::TemplateFloatOutput::write_state(float)
[17:01:54]3fffff00: 3fff267c 3f800000 00000000 40209ecc
WARNING Decoded 0x40209ecc: esphome::output::FloatOutput::set_level(float)
[17:01:54]3fffff10: 00000000 00000000 4bc6a7f0 0000ce30
[17:01:54]3fffff20: 00000000 3ffe9baa 3fff310c 40209f82
WARNING Decoded 0x40209f82: esphome::speed::SpeedFan::loop()
[17:01:54]3fffff30: 3fff4c4c 00000002 3fff0c60 402264d4
WARNING Decoded 0x402264d4: esphome::Component::call_loop()
[17:01:54]3fffff40: 3fff4c4c 00000002 3fff0c60 40226549
WARNING Decoded 0x40226549: esphome::Component::call()
[17:01:54]3fffff50: 3fffdad0 00000002 3fff0c60 4020f479
WARNING Decoded 0x4020f479: esphome::Application::loop()
[17:01:54]3fffff60: 007a1200 ffe706a2 3fff2a00 3fff29ac
[17:01:54]3fffff70: 3fff310c 3fff4c5c 3fff27f4 feefeffe
[17:01:54]3fffff80: 00000000 00000000 00000001 3fff1068
[17:01:54]3fffff90: 3fffdad0 00000000 3fff1028 4021240c
WARNING Decoded 0x4021240c: loop
[17:01:54]3fffffa0: 3fffdad0 00000000 3fff1028 40223f38
WARNING Decoded 0x40223f38: loop_wrapper() at core_esp8266_main.cpp
[17:01:54]3fffffb0: feefeffe feefeffe 3ffe856c 40100699
WARNING Decoded 0x40100699: cont_wrapper
[17:01:54]<<<stack<<<
[17:01:54]
[17:01:54]--------------- CUT HERE FOR EXCEPTION DECODER ---------------
[17:01:54]
[17:01:54] ets Jan 8 2013,rst cause:2, boot mode:(3,6)
[17:01:54]
[17:01:54]load 0x4010f000, len 3584, room 16
[17:01:54]tail 0
[17:01:54]chksum 0xb0
[17:01:54]csum 0xb0
[17:01:54]v2843a5ac
[17:01:54]~ld
[17:01:54]
[17:01:54]SDK:2.2.2-dev(38a443e)/Core:2.7.3-3-g2843a5ac=20703003/lwIP:STABLE-2_1_2_RELEASE/glue:1.2-30-g92add50/BearSSL:5c771be
[17:01:54][I][logger:166]: Log initialized
substitutions:
device: smarthotte
name: Smart Hotte
reboot_timeout: 1h
update_interval: 60s
delayed_on_off: 100ms
pin_relay_lamp: D0
pin_relay_fan1: D3
pin_relay_fan2: D2
pin_relay_fan3: D1
pin_button_lamp: D4
pin_button_up: D5
pin_button_down: D6
pin_IR: D7
# D8 empty, output only, and locks on start if I connect it to a relay (pulled high)
esphome:
name: ${device}
platform: ESP8266
board: nodemcuv2
<<: !include common/common.yaml
# <<: !include common/logger.yaml
logger:
level: DEBUG
<<: !include common/sensors.yaml
debug:
remote_receiver:
pin:
number: ${pin_IR}
inverted: True
mode: INPUT_PULLUP
dump: all
switch:
- !include common/switch/restart.yaml
- platform: gpio
id: fan_low_relay
pin:
number: ${pin_relay_fan1}
inverted: yes
restore_mode: ALWAYS_OFF
interlock: &interlock_group [fan_low, fan_med, fan_high]
interlock_wait_time: 100ms
- platform: gpio
id: fan_med_relay
pin:
number: ${pin_relay_fan2}
inverted: yes
restore_mode: ALWAYS_OFF
interlock: *interlock_group
interlock_wait_time: 100ms
- platform: gpio
id: fan_high_relay
pin:
number: ${pin_relay_fan3}
inverted: yes
restore_mode: ALWAYS_OFF
interlock: *interlock_group
interlock_wait_time: 100ms
- platform: gpio
id: relay_light
name: Light
restore_mode: ALWAYS_OFF
pin:
inverted: yes
number: ${pin_relay_lamp}
- platform: template
id: fan_off
lambda: |-
if (id(fan_hotte).state){
return false;
} else {
return true;
}
turn_on_action:
- fan.turn_off:
id: fan_hotte
- platform: template
id: fan_low
turn_on_action:
- fan.turn_on:
id: fan_hotte
speed: LOW
- platform: template
id: fan_med
turn_on_action:
- fan.turn_on:
id: fan_hotte
speed: MEDIUM
- platform: template
id: fan_high
turn_on_action:
- fan.turn_on:
id: fan_hotte
speed: HIGH
binary_sensor:
- !include common/binary_sensor/status.yaml
- platform: gpio
pin:
number: ${pin_button_up}
mode: INPUT_PULLUP
inverted: yes
id: button_up
filters:
- delayed_on_off: ${delayed_on_off}
on_press:
then:
- lambda: |-
if (id(fan_hotte).state) {
if (id(fan_hotte).speed == 0) {
id(fan_med).turn_on();
ESP_LOGD("main", "Fan set to Medium");
} else {
if (id(fan_hotte).speed == 1){
id(fan_high).turn_on();
ESP_LOGD("main", "Fan set to High");
} else {
ESP_LOGD("main", "Captain, I'm giving her all she's got!");
}
}
} else {
id(fan_low).turn_on();
ESP_LOGD("main", "Fan set to Low");
}
- platform: gpio
pin:
number: ${pin_button_down}
mode: INPUT_PULLUP
inverted: yes
filters:
- delayed_on_off: ${delayed_on_off}
id: button_down
on_press:
then:
- lambda: |-
if (id(fan_hotte).state) {
if (id(fan_hotte).speed == 0) {
id(fan_off).turn_on();
ESP_LOGD("main", "Fan set to Off");
} else {
if (id(fan_hotte).speed == 1){
id(fan_low).turn_on();
ESP_LOGD("main", "Fan set to Low");
} else {
id(fan_med).turn_on();
ESP_LOGD("main", "Fan set to Medium");
}
}
} else {
ESP_LOGD("main", "He's dead, Jim");
}
- platform: gpio
pin:
number: ${pin_button_lamp}
mode: INPUT_PULLUP
inverted: yes
id: button_light
filters:
- delayed_on_off: ${delayed_on_off}
on_press:
then:
- switch.toggle: relay_light
# IR codes from https://github.com/JameZUK/hob2hood-RAW-IR-Codes
- platform: remote_receiver
id: Hob2Hood_Speed_Off
raw:
code: [-720, 1468, -722, 1470, -2114, 1472, -722, 1470, -1416, 2218, -724, 1470, -724, 720, -698]
on_press:
then:
- fan.turn_off:
id: fan_hotte
- platform: remote_receiver
id: Hob2Hood_Speed_Low
raw:
code: [-1416, 1494, -722, 1570, -1974, 1510, -722, 1468, -726, 718, -724, 1468, -724, 2216, -696]
on_press:
then:
- fan.turn_on:
id: fan_hotte
speed: LOW
- platform: remote_receiver
id: Hob2Hood_Speed_Medium
raw:
code: [-1440, 1472, -724, 2936, -752, 2190, -3530, 2224, -2114]
on_press:
then:
- fan.turn_on:
id: fan_hotte
speed: MEDIUM
- platform: remote_receiver
id: Hob2Hood_Speed_High
raw:
code: [-696, 2240, -2784, 2968, -2116, 750, -724, 2216, -2114]
on_press:
then:
- fan.turn_on:
id: fan_hotte
speed: HIGH
- platform: remote_receiver
id: Hob2Hood_Speed_Turbo
raw:
code: [-1416, 2244, -1418, 722, -1418, 2216, -1418, 1470, -724, 2216, -722, 722, -1392]
on_press:
then:
- fan.turn_on:
id: fan_hotte
speed: HIGH
- platform: remote_receiver
id: Hob2Hood_Light_On
raw:
#code: [-654, 1525, -626, 802, -1330, 802, -626, 1524, -627, 774, -1354, 2975, -626, 800, -627, 800, -1327]
code: [-718, 1472, -720, 726, -1388, 752, -718, 1472, -694, 750, -1390, 2994, -720, 724, -720, 726, -1386]
on_press:
then:
- switch.turn_on:
id: relay_light
- platform: remote_receiver
id: Hob2Hood_Light_Off
raw:
code: [-684, 1488, -658, 778, -684, 758, -686, 2278, -660, 788, -628, 1532, -688, 1504, -686, 786, -658]
on_press:
then:
- switch.turn_off:
id: relay_light
output:
- platform: template
id: fanoutput
type: float
write_action:
- if:
condition:
lambda: return ((state < 0.33));
then:
# action for off
- switch.turn_off: fan_low_relay
- switch.turn_off: fan_med_relay
- switch.turn_off: fan_high_relay
- if:
condition:
lambda: return ((state > 0) && (state < .34));
then:
# action for low
- switch.turn_off: fan_med_relay
- switch.turn_off: fan_high_relay
- switch.turn_on: fan_low_relay
- if:
condition:
lambda: return ((state > .34) && (state < .7));
then:
# action for medium
- switch.turn_off: fan_low_relay
- switch.turn_off: fan_high_relay
- switch.turn_on: fan_med_relay
- if:
condition:
lambda: return ((state > 0.99));
then:
# action for high
- switch.turn_off: fan_low_relay
- switch.turn_off: fan_med_relay
- switch.turn_on: fan_high_relay
fan:
- platform: speed
output: fanoutput
id: fan_hotte
name: "Fan"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment