#!/bin/bash #datos=`curl http://envoy.local/production.json 2>/dev/null` datos=`curl http://192.168.1.141/production.json 2>/dev/null` # # obtiene datos de producción de inverters # pi_type=`echo $datos|jq .production[0].type` pi_activeCount=`echo $datos|jq .production[0].activeCount` tmp=`echo $datos|jq .production[0].readingTime` pi_readingTime=`date -d @$tmp +"%Y-%m-%d %H:%M:%S"` pi_wNow=`echo $datos|jq .production[0].wNow` pi_whLifetime=`echo $datos|jq .production[0].whLifetime` # # Mostrar resultados # #echo "Type: '$pi_type'" #echo "activeCount: '$pi_activeCount'" #echo "readingTime: '$pi_readingTime'" #echo "wNow: '$pi_wNow'" #echo "whLifetime: '$pi_whLifetime'" # insertar en la tabla mysql -h $DB_HOST -u root -p'Dsa-0213' enphase <