Commit Graph

2703 Commits

Author SHA1 Message Date
Sammy BAUER
f73917decc Configure Thingspeak URL at runtime (#2124)
* Permit thingspeak urn edit

* Update thinkspeak.ino

* Update index.html

* Replace Host, Port, and URL with Address in Thingspeak

* Create AsyncThingspeak object

Create AsyncThingspeak object to contain the url of the component.

* replace pointer by class member

Thingspeak class improvement to answer Max's question:
why use a pointer when it can be a class member?
So now address parameter isn't a pointer anymore.

* Update Thingspeak address on post
2020-02-09 01:15:27 +03:00
Max Prokhorov
460083c28f Show pretty uptime with NTP_SUPPORT (#2137)
Fallback to basic N seconds display when disabled
2020-02-04 19:56:43 +03:00
Max Prokhorov
1a6b709a8f Fix ADE7953 typo (#2136) 2020-02-04 19:21:31 +03:00
Max Prokhorov
cda3dab0a1 Fix rpnSticky inverse condition (#2135) 2020-02-04 19:20:15 +03:00
Max Prokhorov
f7f41980b6 Headers cleanup (#2134)
* Config: remove prototypes.h

* fixup order

* word

* add missing

* fix warning while still using .ino

* bad at c/p;
2020-02-04 10:02:01 +03:00
Max Prokhorov
ba3ec47ed0 NTP: use sntp app from lwip on latest Cores, replace ntpclientlib (#2132)
* ntp: try using sntp app from lwip, drop ntpclientlib

* fix display

* thermostat: fix day and month getters

* test build sizes with scheduler

* use system timers for once-a-minute scheduling, no polling

* tick

* avoid timestamps, use tm

* drop utc rpn operator, add utc_hour and utc_dow

* try to build with old implementation too

* dep

* notify ws

* progmem

* cleanup types

* offset tm values by 1 to match existing schedules

* avoid using ntpclientlib with rpn

* test. show debug strings in sch

* fix secureclient

* consts, fix unsyncing when changing tz (and not triggering sntp after reinit for some reason)

* startup time in seconds

* same delay as lwip

* header

* assume build timestamp is unixtime

* cache server value

* fmt

* typo

* handle dhcp request

* rename

* web

* TZ.h

* add notice about what alias means

* fix disabling NTP_SUPPORT

* scheduled ticker

* same behaviour as old module

* rollback rpn dependency check, utc_ prefixes

* ...

* comments, refactor naming
2020-02-04 06:17:40 +03:00
Max Prokhorov
37f6247772 Light: configure dimmer pins from settings (#2129)
- add ltDimmerGPIO<index> & ltDimmerInv<index> to override / add to hardware configuration. Add pin defaults, mapped as GPIO_NONE. pwm_init() receives resulting GPIO mapping based on settings loader.
- remove bogus _light_channels variable, use this name for channel array instead (...which is vector and has size(). functions always use that value anyway)
2020-02-04 02:51:44 +03:00
Max Prokhorov
833978d75f Merge pull request #2130 from mcspr/ci/pio-test
Fix UnixHostDuino dependency
2020-02-04 02:15:01 +03:00
Max Prokhorov
0d40d2275a Load sensor classes later (#2128)
* Sensors: refactor configuration

- move sensor implementaion to the .ino,
  remove dependency undef / define from sensor files
- update test/build/sensor.h from SENSOR_SUPPORT
- allow to change sensor config variables externally
- `#include <...>` for global headers and libraries,
  fix relative path for math library

* add missing sns <-> i2c dependency

* ledrelay should return relay_none as default

* rollback to original test header

* include debug header when requested (relative)
2020-02-04 02:14:31 +03:00
Max Prokhorov
a41819a28a ci: run pio test directory 2020-01-29 23:59:39 +03:00
Maxim Prokhorov
712bd8a5e1 Buttons: small optimization for vector 2020-01-22 01:56:59 +03:00
Maxim Prokhorov
d1df9d5587 Add timelib header in utils 2020-01-22 01:44:50 +03:00
Maxim Prokhorov
2e891e3129 Debug: use lowercase enum for mode (following isocpp guidelines) 2020-01-22 01:44:50 +03:00
Maxim Prokhorov
2ff50169b9 Static configuration for LED and Buttons
- use similar to relay & wifi, configuration through helper methods that
  use indexed defines
- clock cycles for led delay polling
- button mode defaults
2020-01-22 01:44:50 +03:00
Max Prokhorov
495fa18a27 Debug: log mode, allow to skip boot messages (#2116)
* debug: log mode, allow to skip boot messages

* typo, fix warning about unhandled switch

* mention telnet wifiserver & reverse changes
2020-01-21 01:48:52 +03:00
Max Prokhorov
a4d4231ae0 PIO: remove -ota envs, handle OTA condition in extra script (#2099)
* PIO: remove -ota envs, handle OTA condition in extra script
* Tweak ESPURNA_BOARD variable
* Support git and latest in ota script
* Handle ESPURNA_FLAGS too
* Try to handle env and projenv in pylint
* Add deprecation comment about -ota envs
* regen arduino.h
2020-01-20 17:41:10 +03:00
Max Prokhorov
298ce8cac2 Refactor get/set/del/hasSetting (#2048)
* experimental: refactor get/set/del/hasSetting

* sensors

* lights

* cleaup

* r

* tuya

* fixup! sensors

* fixup! tuya

* header defaults types

* fix lights

* setup already checks for max

* helper for flashstring

* fix overload

* oops

* refactor includes

* warnings

* test with migrate

* add ids in a separate file

* cleanup

rev: crash

rev: domoticz

rev: encoder

rev: loopdelay

rev: hass

rev: i2c

rev2: hass

rev: mqtt

rev: rfm69

rev: relay

rev: rpn

rev: settings setup

rev: hb settings

rev: telnet preprocessor fix

rev: settings wrap

rev: tspk bool style

rev: wifi types

rev: util hb

rev: settings

fixup! rev: settings

* rev: cleanup wifi injections based on new getters

* hasSetting now can return true for empty key

* show hardcoded network in web

* oops

* fix ws referencing wrong index

* ensure empty strings are written

* c/p

* use experimental schema style for payload, mark network as not deletable

* allow to customize converter

* shorter syntax, try using with wifi

* use proper #if syntax to handle definitions that are missing

* fixup ota sc checks getter, cast schEnabled to bool

* add utils header to sensors
2020-01-20 16:39:35 +03:00
Tomas Bara
c196fa2542 Set MQTT will topic after /get suffix initialization #2106 (#2115) 2020-01-20 15:44:11 +03:00
Anders Blockmar
55a73b1c6e Added hardware config for Avatto NAS-WR01W (#2113)
Not a match to same model from Neo Coolcam
2020-01-20 15:42:16 +03:00
foxman69
ac2f9c2c57 Fixed update of led bug and GPIO16 support (#2110)
* Fixed ignorance from the 16th PIN on ESP8266

* Added update to led every change of relay

* per https://github.com/xoseperez/espurna/pull/2110#discussion_r367551042

* gpio16 comment

Co-authored-by: Max Prokhorov <prokhorov.max@outlook.com>
2020-01-20 15:41:11 +03:00
Max Prokhorov
cb28cac301 Debug: store boot log (#2109)
* debug: store boot log

* order

* roll single header

* hide when not implemented

* fix capacity check

* dependencies

* refactor names, can just use malloc

* settings formatting

* dbgBuf prefix

* show size

* release memory after buffer is displayed

* fix uptime unused warning, combine printer

* comments

* use arg flag instead of static to handle boot

* ci test fix

* Hide whole info() without debug

* typo

* cleanup setDebugOutput condition
2020-01-20 15:40:43 +03:00
foxman69
e3887da8a0 WebUI: Fix scheduler panel tabindex= values (#2096)
* added data-settings-max value to html

* fixed: use the value and not the defenition of the function

* the schedules variable already starts from 0 not need to increment

* another misuse of function as variable
2020-01-13 14:33:28 +03:00
orrpan
57a441a811 Deltaco smart home (#2103)
* add support for DELTACO SH-P01

* renaming deltaco_sh_le14w to deltaco_sh_lexxw

* add support Deltaco SH-P03USB and SH-LEXXRGB
2020-01-13 14:31:17 +03:00
Wil Wilsman
c25d6509bf Add MagicHome ZJ_LB_RGBWW_L support (#2100) 2020-01-13 14:29:25 +03:00
Marcus Winkler
4d978a46ac Add support for Teckin SB53 smart bulb (#2090) 2020-01-13 14:06:13 +03:00
Aurélien Requiem
a170716e90 Add support for Kogan Smarter Home Plug With Energy Meter (#2086)
* Add support for Kogan Smarter Home Plug With Energy Meter

Type: Power Plug
Board: Kogan Smarter Home Plug with Energy Meter
Build flag: KOGAN_SMARTER_HOME_PLUG_W_POW
Description: Power Plug with integrated Energy Meter
Baseboard: Tuya TYWE3S
Baseboard Data sheet: https://docs.tuya.com/docDetail?code=K8uhkbb1ihp8u

* Include Kogan Smarter Home plug with energy meter (KOGAN_SMARTER_HOME_PLUG_W_POW) into arduino.h

* Update platformio.ini to support Kogan Smarter Home plug with energy meter (KOGAN_SMARTER_HOME_PLUG_W_POW)

* Add Kogan Smarter Home plug with energy meter product image

* fix platformio.ini that was missing a '-ota' for the environment

* comment out device definition

* Make device name consistent with #define and platformio.ini
2020-01-13 14:05:32 +03:00
Max Prokhorov
cfd2bccb4a Version 1.14.2-dev (#2098) 2020-01-13 10:27:43 +03:00
Max Prokhorov
62ad7da332 Version 1.14.1 (#2093)
* Version 1.14.1

* fix autoreplace

* formatting
2019-12-31 05:55:49 +03:00
Max Prokhorov
37763f1ad4 Test: check core feature build (#2080)
* Test: check core feature build

* order

* add missing
2019-12-21 16:13:29 +03:00
Max Prokhorov
9edccd1c21 Scripts: ota.py version 0.4 (#2020)
* use basic sleep instead of busyloop
* print immediately when no sort option is specified, disable default hostname sort
* restructure
* update requirements.txt
* cli timeout arg, increase default timeout to ensure that all devices are found
* use black for formatting
* shorter ifs
2019-12-21 00:43:53 +03:00
Max Prokhorov
4f5e9fa1b7 OTA: verify data stream and properly handle errors (#2067)
* webui: improve updater error message

* ota: properly check updater state and finalize on errors

* finish up ota handling refactor

* fail web upgrade when cannot find magic byte

* send updater status with no payload arg and always send payload with

* mention magic byte and flash mode in webui

* gzip magic

* make async ota at least usable. timeouts, show errors, try harder to find data after headers

* simplify setup and destruction

* cleanup class instantiations for ota and url

* handle default case of magicflashchipsize

* shorter

* blobs
2019-12-21 00:19:15 +03:00
Max Prokhorov
43cf926468 ha: try to avoid conflict with useCSS (#2075) 2019-12-21 00:07:10 +03:00
Max Prokhorov
8066bbf7d5 hw: set button pullup on shpx-v23 boards (#2074) 2019-12-21 00:06:50 +03:00
Max Prokhorov
0f02256860 Small fixes (#2071)
* web: fix rfb node generator syntax, do not send as basic settings

* ha: allocate discovery object later
2019-12-19 00:56:29 +03:00
Max Prokhorov
76ba6d52d7 Recover -ota block for #2042 2019-12-18 17:55:23 +03:00
Max Prokhorov
56ab28cd68 Update PIO platforms comment 2019-12-18 17:54:20 +03:00
Niek van der Maas
de2179cf25 Update Arduino core to 2.3.2 (#2069) 2019-12-18 17:46:47 +03:00
Max Prokhorov
8e7854b04e WebUI fix change detection of input elements (#1986)
- use setOriginalsFromValues function right after elements had changed and
**only** with those elements
- add checkbox handling to setOriginalsFromValues to match hasChanged
- apply hasChanged after value is set to refresh originals after saving
- change parts that already set 'original' attribute manually

This was sort-of broken, because original attr never worked as intended. 
Also fix possible OOM for large WebUI images, since sending full config each time means that we need more memory to buffer and parse it.
2019-12-18 17:45:51 +03:00
Max Prokhorov
e5b72a0d43 Device: add LOHAS_E26_A19, rename LOHAS_9W to LOHAS_E27_9W (#2068) 2019-12-16 14:41:35 +03:00
Max Prokhorov
96a13f39c3 Influxdb: don't queue any data while connecting 2019-12-16 14:40:43 +03:00
sehraf
c0c325ee3b Add support for the LSC LED LIGHT STRIP from ACTION using a tuya chip. (#2065)
This LED strip is sold by ACTION in Germany and comes with a Tuya (TYWE3L) chip. It can be "freed" by using tuya-convert. It has (yet another) IR remote control that uses another set of codes. Which is added, too. The color codes are copies from SET 1 and 2.
I kind of think that they don't match my remote control but since i'm using my smart home system for controlling, i don't care enough to figure out the correct color codes.

The circuit board supports also a CW channel on PIN 5 (which is not used on by version), nevertheless I've added a comment in case anybody has a similar device with CW
2019-12-16 14:35:41 +03:00
Max Prokhorov
c6758e4844 Revert "ir: use proper methods" (#2066)
This reverts commit 7efaaa8a80.
2019-12-16 14:09:52 +03:00
Max Prokhorov
0ae6e3b48e Influxdb: fix sensor send frequency, use async client, send data in batches (#2061)
* broker: drop REAL_TIME flag, use separate Broker entities

* influxdb: use async client, send data in batches
2019-12-16 14:09:09 +03:00
Max Prokhorov
8e8c990ff0 Device: MAGICHOME_ZJ_WFMN_C_11 (#2051) 2019-12-16 14:08:24 +03:00
Vencislav Atanasov
b1d34885b1 Add support for eHomeDIY devices. (#2046)
We have created a few dozens of devices, released as open-source hardware and
published the schematics to GitHub. We're planning to organize some small
(10-15 people) workshops on how to assemble, flash and configure these board.

https://github.com/eHomeDIY
2019-12-16 14:07:01 +03:00
mpcusack
9c5dc67320 Add support for LinkSprite R4 (#2042)
* Add LinkSprite R4 def

* Platformio.ini def for linksprite r4

* LINKSPRITE_LINKNODE_R4
2019-12-16 14:04:25 +03:00
orrpan
e64ec2a9e3 Device: add GENERIC_E14, e14 rgb+w 4,5w (#2039) 2019-12-16 13:58:17 +03:00
foxman69
5cf687ffc1 WebUI: Fixed small aesthetic problem (#2038)
* Fixed small esthetic problem

* Changed to legend
2019-12-09 09:22:51 +03:00
Max Prokhorov
2ef21d840d WebUI: fix some issues
- fix colorpicker variable name
- var msg and var pre for debug messages
- add gpio16 to gpio list, remove unused template code
- fix lightfox endif matching rfbridge instead of lightfox
- formatting
2019-12-09 09:10:40 +03:00
Max Prokhorov
15accf8090 web: check sch_last existence (#2050) 2019-12-09 07:40:36 +03:00