patfelst / Iron-Timer-Mk2

ESPHome Iron Timer
5 stars 1 forks source link

No Email #1

Closed thieaux closed 4 years ago

thieaux commented 4 years ago

I haven't tried it yet, but i have been reading the yaml, that is some beautiful code there mate.. nice one

patfelst commented 4 years ago

hey mate, glad you like it. What's with the title "No Email?".

There's probably about 20% more code than really necessary for setting the brightness of the display with the rotary encoder, and making the display go to sleep after a 30 second timer. But I had fun developing it.

It's just a pity that the lead dev of ESPHome isn't currently doing releases, so a lot of bugs and feature requests are not being addressed. I'm now looking doing this in arduino code with MQTT back to home assistant.

thieaux commented 4 years ago

The "No Email" was to get your attention, i really wanted to congratulate you on this code. Your code is perfect, it allows less experinced people to have a starting point, I've been on lockdown trying to get working a little IoT project, a IoT gas range controller if you will, i wanted to replace the original motherboard that came with the gas range that went bad and the service store wanted 300 us for a used one, i took apart and realized is not that complicated ...

So i started with an arduino, a couple of ssr and a ink bird temp controller, the arduino was just a state machine that would allow to select between the bake or broil option..that worked fine, but u know how it is we need to make it harder on ourselves. Now i want to tap on the K probe thats sensing the temp. through an amplifier (max31855, maybe), report that temp to ha, and also to a 7 segment on top of the oven, --here is were your code comes in -- and an encoder that would set a timer that would turn off the ssr and push a message to my phone/ home speakers ...future plans include the meat probe thing ..

i tried running this on arduino code, certainly was easier with the libraries and all and the pub/sub to ha was pretty straight forward. But for some reason i couldn't make it work, i had a bunch of issues with the available encoder libraries at the end i decided to just go with esphome and see what i can sort out. anyways again mate, well done

edit: maybe add on the readme, requires "ESPHOME API" integration since ur not using mqtt

patfelst commented 4 years ago

hey mate, I've added my email address now.

thieaux commented 4 years ago

Hey, I've been hacking away at your code for a couple of days to finish my bbq controller, but I'm not very proficient at c++ and i ve been having some difficulties understanding the syntax of the log library, do you mind explaining briefly the following calls;

//ESP_LOGW("rotary", "rotary enc=%2.2f", x);

//ESP_LOGW("case 2: LED brightness", "brightness=%.1f", id(led_brightness));

//ESP_LOGW("display", "Mode = %d", id(rotary_encoder_mode));

I understand that "rotary enc=%2.2f" means that it will store "rotary enc= as a float of2 digits and 2 decimals places , but after that i don't fully comprehend the "rotary" and the "x". same with case 2 : what is suppose to happen here with "case 2: LED Brightness and id(rotary_encoder_mode)

Thanks

patfelst commented 4 years ago

The logging statements are documented at https://esphome.io/components/sensor/custom.html?highlight=esp_logw#logging-in-custom-components

I use these for debugging during development to check on the value of variables. The log statements print to the "Show Logs" view once the program is running. Nothing is being stored here, it's simply print statements. The first thing in quotes is just a title that gets printed too. I normally put the name of the component e.g. "rotary", but you can put whatever you want there.

Basically you just format them like C++ printf statements.

The first one with the "x" is a little unusual. "x" is a variable that ESPHome creates for each sensor. It's the filtered value of the sensor as explained here https://esphome.io/components/sensor/index.html#on-value

thieaux commented 4 years ago

Ahhh ok, great !! Thanks....i was scratching my head because i believed you where storing this values to be called later on the case statements. Like i said i literally have zero knowledge of C++, but now i know is for debugging purposes, excellent thank you