You can use a nodemcu with an external trigger circuit to develop your solution. Connect a relay or an electronic trigger circuit to generate trigger signal for the NODEMCU. So when the door bell rings, it sets a high trigger to the NodeMCU and this trigger can be used to send a signal to the MQTT topic.
A mobile app can subscribe to this MQTT topic to show ...
MQTT is a great choice if the application requires the following:
Transmission of data between devices or from device to a server
Reliability of data transfer
Capability to scale
Compatibility with low-power devices
Robust for unreliable Internet connections
It sounds like your application has these requirements and that MQTT would be a sufficient solution....
MQTT is a good choice for you to send the sensor data to the central server. It is light weight and scalable. You can consume the data directly from a web interface or store it in a database. You can use node-red for creating streaming pipelines and visualizations
The client.connect() function takes a hostname, not a URL as it's first argument.
The failure is because the client is trying to resolve wss://psmart-test-api.aegean.gr/ws/ as a hostname.
You should just be passing psmart-test-api.aegean.gr as the first argument of the function.
To change the path section of the connect URL then you will need to use the ...
I wonder if the publishing client is doing its entire sequence of connect and security handshakes at the time when you want to send your first message. The connect and handshakes can take some time over cellular networks, especially 3G.
Perhaps you can share the code of the publisher. That would help.
In regards to your second question, Mosquitto does have ...