How many components can be created in one ESPHOME?

How many components can be created in one ESPHOME?

The same as the number of feet in the length of this piece of string.

Seriously, it depends on which components (some of them take more memory space than others) and which device you are using (some of them have more memory than others).

I would just keep adding stuff until something breaks. Of course there will be some limit to the resources an 8266 or a 32 can offer, but exactly what it can handle depends on many things. There’s no way to calculate an answer to your question.

[edit: The accepted approach is drive it as hard as you can until it breaks, then get a faster one. I am still amazed at what can be done in reality with just a lowly 2560 'duino… 3d printers, drones, etc… and an 8266 can do a lot more.]

I made a large number of components using ESP32 (4MB)
About 50EA
Compilation was normal, and writing was good.
Memory usage is about 50%
The number of lines in the source code is about 1000 lines
However, it does not operate normally.

The error log is:
Exception in thread Thread-1:
Traceback (most recent call last):
File “/usr/local/lib/python3.6/dist-packages/google/protobuf/internal/python_message.py”, line 1127, in MergeFromString
if self._InternalParse (serialized, 0, length)! = length:
File “/usr/local/lib/python3.6/dist-packages/google/protobuf/internal/python_message.py”, line 1179, in InternalParse
buffer, new_pos, wire_type) # pylint: disable = protected-access
File “/usr/local/lib/python3.6/dist-packages/google/protobuf/internal/decoder.py”, line 968, in _DecodeUnknownField
(data, pos) = _DecodeUnknownFieldSet (buffer, pos)
File “/usr/local/lib/python3.6/dist-packages/google/protobuf/internal/decoder.py”, line 947, in _DecodeUnknownFieldSet
(data, pos) = _DecodeUnknownField (buffer, pos, wire_type)
File “/usr/local/lib/python3.6/dist-packages/google/protobuf/internal/decoder.py”, line 968, in _DecodeUnknownField
(data, pos) = _DecodeUnknownFieldSet (buffer, pos)
File “/usr/local/lib/python3.6/dist-packages/google/protobuf/internal/decoder.py”, line 947, in _DecodeUnknownFieldSet
(data, pos) = _DecodeUnknownField (buffer, pos, wire_type)
File “/usr/local/lib/python3.6/dist-packages/google/protobuf/internal/decoder.py”, line 968, in _DecodeUnknownField
(data, pos) = _DecodeUnknownFieldSet (buffer, pos)
File “/usr/local/lib/python3.6/dist-packages/google/protobuf/internal/decoder.py”, line 947, in _DecodeUnknownFieldSet
(data, pos) = _DecodeUnknownField (buffer, pos, wire_type)
File “/usr/local/lib/python3.6/dist-packages/google/protobuf/internal/decoder.py”, line 968, in _DecodeUnknownField
(data, pos) = _DecodeUnknownFieldSet (buffer, pos)
File “/usr/local/lib/python3.6/dist-packages/google/protobuf/internal/decoder.py”, line 942, in _DecodeUnknownFieldSet
(tag_bytes, pos) = ReadTag (buffer, pos)
File “/usr/local/lib/python3.6/dist-packages/google/protobuf/internal/decoder.py”, line 192, in ReadTag
while six.indexbytes (buffer, pos) & 0x80:
IndexError: index out of bounds on dimension 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
self.run ()
File “/usr/local/lib/python3.6/dist-packages/esphome/api/client.py”, line 396, in run
self._run_once ()
File “/usr/local/lib/python3.6/dist-packages/esphome/api/client.py”, line 386, in _run_once
msg.ParseFromString (raw_msg)
File “/usr/local/lib/python3.6/dist-packages/google/protobuf/message.py”, line 187, in ParseFromString
return self.MergeFromString (serialized)
File “/usr/local/lib/python3.6/dist-packages/google/protobuf/internal/python_message.py”, line 1133, in MergeFromString
raise message_mod.DecodeError (‘Truncated message.’)
google.protobuf.message.DecodeError: Truncated message.

However, by reducing the number of componenst, it boots normally and works well.

So I asked if there was a limit on the number.

Please read the above reply.

I suggest that this should probably be posted to the github issues page.

I agree with nick, I’d submit an issue on the esphome github.